본문 바로가기

1 Day 1 Algorithms65

[2019.01.28] Grading Students Problem HackerLand University has the following grading policy:Every student receives a in the inclusive range from to .Any less than is a failing grade.Sam is a professor at the university and likes to round each student's according to these rules:If the difference between the and the next multiple of is less than , round up to the next multiple of .If the value of is less than , no rounding oc.. 2019. 1. 28.
[2019.01.25] Time Conversion Problem Given a time in -hour AM/PM format, convert it to military (24-hour) time.Note: Midnight is 12:00:00AM on a 12-hour clock, and 00:00:00 on a 24-hour clock. Noon is 12:00:00PM on a 12-hour clock, and 12:00:00 on a 24-hour clock.Function DescriptionComplete the timeConversion function in the editor below. It should return a new string representing the input time in 24 hour format.timeConve.. 2019. 1. 25.
[2019.01.24] Birthday Cake Candles Problem You are in charge of the cake for your niece's birthday and have decided the cake will have one candle for each year of her total age. When she blows out the candles, she’ll only be able to blow out the tallest ones. Your task is to find out how many candles she can successfully blow out.For example, if your niece is turning years old, and the cake will have candles of height , , , , she.. 2019. 1. 24.
[2019.01.23] Bitwise AND Problem Objective Welcome to the last day! Today, we're discussing bitwise operations. Check out the Tutorial tab for learning materials and an instructional video!Task Given set . Find two integers, and (where ), from set such that the value of is the maximum possible and also less than a given integer, . In this case, represents the bitwise AND operator.Input FormatThe first line contains an i.. 2019. 1. 23.
[2019.01.22] RegEx, Patterns, and Intro to Databases Problem Objective Today, we're working with regular expressions. Check out the Tutorial tab for learning materials and an instructional video!Task Consider a database table, Emails, which has the attributes First Name and Email ID. Given rows of data simulating the Emails table, print an alphabetically-ordered list of people whose email address ends in .Input FormatThe first line contains an int.. 2019. 1. 22.
[2019.01.21] Testing Problem This problem is all about unit testing.Your company needs a function that meets the following requirements:For a given array of integers, the function returns the index of the element with the minimum value in the array. If there is more than one element with the minimum value, the returned index should be the smallest one.If an empty array is passed to the function, it should raise an E.. 2019. 1. 21.
[2019.01.17] Nested Logic Problem Objective Today's challenge puts your understanding of nested conditional statements to the test. You already have the knowledge to complete this challenge, but check out the Tutorial tab for a video on testing!Task Your local library needs your help! Given the expected and actual return dates for a library book, create a program that calculates the fine (if any). The fee structure is as.. 2019. 1. 17.
[2019.01.16] Running Time and Complexity Problem Objective Today we're learning about running time! Check out the Tutorial tab for learning materials and an instructional video!Task A prime is a natural number greater than that has no positive divisors other than and itself. Given a number, , determine and print whether it's or .Note: If possible, try to come up with a primality algorithm, or see what sort of optimizations you come up .. 2019. 1. 16.
[2019.01.15] More Linked Lists Problem Objective Check out the Tutorial tab for learning materials and an instructional video!Task A Node class is provided for you in the editor. A Node object has an integer data field, , and a Node instance pointer, , pointing to another node (i.e.: the next node in a list).A removeDuplicates function is declared in your editor, which takes a pointer to the node of a linked list as a paramet.. 2019. 1. 15.