Problem solving/Algorithms 41

[LeetCode] 1365. How Many Numbers Are Smaller Than the Current Number (Python)

LeetCode - Problems - Algorithms - 1365. How Many Numbers Are Smaller Than the Current Number Problem Description Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the number of valid j's such that j != i and nums[j] < nums[i] . Return the answer in an array. Example: Constraints: My Solution (Python) cl..

[LeetCode] 1431. Kids With the Greatest Number of Candies (Python)

LeetCode - Problems - Algorithms - 1431. Kids With the Greatest Number of Candies Problem Description Given the array candies and the integer extraCandies, where candies[i] represents the number of candies that the ith kid has. For each kid check if there is a way to distribute extraCandies among the kids such that he or she can have the greatest number of candies among them. Notice that multipl..

An array of divisible numbers (나누어 떨어지는 숫자 배열)

Question Write the solution which returns an array that includes numbers capable of being divided by a divisor provided and in ascending order. If there is no divisible number, then return an array contains -1. Limitation arr is an array that includes only natural numbers. For integer i and j, if i =! j, then arr[i] =! arr[j]. The divisor is a natural number. array's length is equal or longer th..