코딩92 CodeSignal [44/60] findEmailDomain Problem: An email address such as "John.Smith@example.com" is made up of a local part ("John.Smith"), an "@" symbol, then a domain part ("example.com"). The domain name part of an email address may only consist of letters, digits, hyphens and dots. The local part, however, also allows a lot of different special characters. Here you can look at several examples of correct and incorrect email addr.. 2020. 5. 26. CodeSignal [43/60] isBeautifulString Problem: A string is said to be beautiful if each letter in the string appears at most as many times as the previous letter in the alphabet within the string; ie: b occurs no more times than a; c occurs no more times than b; etc. Given a string, check whether it is beautiful. Example For inputString = "bbbaacdafe", the output should be isBeautifulString(inputString) = true. This string contains .. 2020. 5. 26. CodeSignal [42/60] bishopAndPawn Problem: Given the positions of a white bishop and a black pawn on the standard chess board, determine whether the bishop can capture the pawn in one move. The bishop has no restrictions in distance for each move, but is limited to diagonal movement. Check out the example below to see how it can move: Example For bishop = "a1" and pawn = "c3", the output should be bishopAndPawn(bishop, pawn) = t.. 2020. 5. 26. CodeSignal [41/60] digitDegree Problem: Let's define digit degree of some positive integer as the number of times we need to replace this number with the sum of its digits until we get to a one digit number. Given an integer, find its digit degree. Example For n = 5, the output should be digitDegree(n) = 0; For n = 100, the output should be digitDegree(n) = 1. 1 + 0 + 0 = 1. For n = 91, the output should be digitDegree(n) = 2.. 2020. 5. 26. CodeSignal [40/60] longestDigitsPrefix Problem: Given a string, output its longest prefix which contains only digits. Example For inputString = "123aa1", the output should be longestDigitsPrefix(inputString) = "123". -Summary- 1. inputString의 각 캐릭터들을 앞에서부터 차례차례 비교하여 만약에 digit일 경우에는 longestDigits 에 넣어주고 아닐경우에는 바로 break 하여 loop 을 나옴 2. loop을 돌며 저장해온 longestDigits 값 return. 모든 문제에 대한 저작권은 CodeSignal 회사에 있습니다. [Copyright © 2020 BrainFigh.. 2020. 5. 26. CodeSignal [39/60] knapsackLight Problem: You found two items in a treasure chest! The first item weighs weight1 and is worth value1, and the second item weighs weight2 and is worth value2. What is the total maximum value of the items you can take with you, assuming that your max weight capacity is maxW and you can't come back for the items later? Note that there are only two items and you can't bring more than one item of each.. 2020. 5. 26. 이전 1 ··· 10 11 12 13 14 15 16 다음