🐍Python/Python_알고리즘

    [알고리즘] 39. Find Digits

    An integer is a divisor of an integer if the remainder of .Given an integer, for each digit that makes up the integer determine whether it is a divisor. Count the number of divisors occurring within the integer.Note: Each digit is considered to be unique, so each occurrence of the same digit should be counted (e.g. for , is a divisor of each time it occurs so the answer is ).Function Description..

    [알고리즘] 38. Jumping on the Clouds: Revisited

    Aerith is playing a cloud hopping game. In this game, there are sequentially numbered clouds that can be thunderheads or cumulus clouds. Her character must jump from cloud to cloud until it reaches the start again.To play, Aerith is given an array of clouds, and an energy level . She starts from and uses unit of energy to make a jump of size to cloud . If Aerith lands on a thundercloud, , her en..

    [알고리즘] 37. Sequence Equation

    Given a sequence of integers, where each element is distinct and satisfies . For each where , find any integer such that and print the value of on a new line.For example, assume the sequence . Each value of between and , the length of the sequence, is analyzed as follows:, so , so , so , so , so The values for are .Function DescriptionComplete the permutationEquation function in the editor below..

    [알고리즘] 36. Circular Array Rotation

    John Watson knows of an operation called a right circular rotation on an array of integers. One rotation operation moves the last array element to the first position and shifts all remaining elements right one. To test Sherlock's abilities, Watson provides Sherlock with an array of integers. Sherlock is to perform the rotation operation a number of times then determine the value of the element a..

    [알고리즘] 35. Save the Prisioner!

    A jail has a number of prisoners and a number of treats to pass out to them. Their jailer decides the fairest way to divide the treats is to seat the prisoners around a circular table in sequentially numbered chairs. A chair number will be drawn from a hat. Beginning with the prisoner in that chair, one candy will be handed to each prisoner sequentially around the table until all have been distr..

    [알고리즘] 34. Viral advertising

    HackerLand Enterprise is adopting a new viral advertising strategy. When they launch a new product, they advertise it to exactly people on social media.On the first day, half of those people (i.e., ) like the advertisement and each shares it with of their friends. At the beginning of the second day, people receive the advertisement.Each day, of the recipients like the advertisement and will shar..