본문 바로가기

1 Day 1 Algorithms65

[2019.02.14] Bon Appetit Problem Anna and Brian are sharing a meal at a restuarant and they agree to split the bill equally. Brian wants to order something that Anna is allergic to though, and they agree that Anna won't pay for that item. Brian gets the check and calculates Anna's portion. You must determine if his calculation is correct.For example, assume the bill has the following prices: . Anna declines to eat item .. 2019. 2. 14.
[2019.02.13] Day of the Programmer Problem Marie invented a Time Machine and wants to test it by time-traveling to visit Russia on the Day of the Programmer (the day of the year) during a year in the inclusive range from to .From to , Russia's official calendar was the Julian calendar; since they used the Gregorian calendar system. The transition from the Julian to Gregorian calendar system occurred in , when the next day after J.. 2019. 2. 13.
[2019.02.12] Migratory Birds Problem You have been asked to help study the population of birds migrating across the continent. Each type of bird you are interested in will be identified by an integer value. Each time a particular kind of bird is spotted, its id number will be added to your array of sightings. You would like to be able to find out which type of bird is most common given a list of sightings. Your task is to p.. 2019. 2. 12.
[2019.02.11] Divisible Sum Pairs Problem You are given an array of integers, , and a positive integer, . Find and print the number of pairs where and + is divisible by .For example, and . Our three pairs meeting the criteria are and .Function DescriptionComplete the divisibleSumPairs function in the editor below. It should return the integer count of pairs meeting the criteria.divisibleSumPairs has the following parameter(s):n:.. 2019. 2. 11.
[2019.02.08] Birthday Chocolate Problem Lily has a chocolate bar that she wants to share it with Ron for his birthday. Each of the squares has an integer on it. She decides to share a contiguous segment of the bar selected such that the length of the segment matches Ron's birth month and the sum of the integers on the squares is equal to his birth day. You must determine how many ways she can divide the chocolate.Consider the .. 2019. 2. 8.
[2019.02.01] Breaking the Records Problem Maria plays college basketball and wants to go pro. Each season she maintains a record of her play. She tabulates the number of times she breaks her season record for most points and least points in a game. Points scored in the first game establish her record for the season, and she begins counting from there.For example, assume her scores for the season are represented in the array . Sc.. 2019. 2. 1.
[2019.01.31] Between Two Sets Problem You will be given two arrays of integers and asked to determine all integers that satisfy the following two conditions:The elements of the first array are all factors of the integer being consideredThe integer being considered is a factor of all elements of the second arrayThese numbers are referred to as being between the two arrays. You must determine how many such numbers exist.For ex.. 2019. 1. 31.
[2019.01.30] Kangaroo Problem You are choreographing a circus show with various animals. For one act, you are given two kangaroos on a number line ready to jump in the positive direction (i.e, toward positive infinity).The first kangaroo starts at location and moves at a rate of meters per jump.The second kangaroo starts at location and moves at a rate of meters per jump.You have to figure out a way to get both kanga.. 2019. 1. 30.
[2019.01.29] Apple and Orange Problem Sam's house has an apple tree and an orange tree that yield an abundance of fruit. In the diagram below, the red region denotes his house, where is the start point, and is the endpoint. The apple tree is to the left of his house, and the orange tree is to its right. You can assume the trees are located on a single point, where the apple tree is at point , and the orange tree is at point .. 2019. 1. 29.