코딩92 CodeSignal [50/60] chessKnight Problem: Given a position of a knight on the standard chessboard, find the number of different moves the knight can perform. The knight can move to a square that is two squares horizontally and one square vertically, or two squares vertically and one square horizontally away from it. The complete move therefore looks like the letter L. Check out the image below to see all valid moves for a knigh.. 2020. 5. 28. CodeSignal [49/60] lineEncoding Problem: Given a string, return its encoding defined as follows: First, the string is divided into the least possible number of disjoint substrings consisting of identical characters for example, "aabbbc" is divided into ["aa", "bbb", "c"] Next, each substring with length greater than one is replaced with a concatenation of its length and the repeating character for example, substring "bbb" is r.. 2020. 5. 27. CodeSignal [48/60] isDigit Problem: Determine if the given character is a digit or not. Example For symbol = '0', the output should be isDigit(symbol) = true; For symbol = '-', the output should be isDigit(symbol) = false. -Summary- 1. Python 의 isdigit()함수로 바로 풀수 있다. 모든 문제에 대한 저작권은 CodeSignal 회사에 있습니다. [Copyright © 2020 BrainFights Inc. All rights reserved] https://codesignal.com/ 2020. 5. 27. CodeSignal [47/60] isMAC48Address Problem: A media access control address (MAC address) is a unique identifier assigned to network interfaces for communications on the physical network segment. The standard (IEEE 802) format for printing MAC-48 addresses in human-friendly form is six groups of two hexadecimal digits (0 to 9 or A to F), separated by hyphens (e.g. 01-23-45-67-89-AB). Your task is to check by given string inputStri.. 2020. 5. 27. CodeSignal [46/60] electionsWinners Problem: Elections are in progress! Given an array of the numbers of votes given to each of the candidates so far, and an integer k equal to the number of voters who haven't cast their vote yet, find the number of candidates who still have a chance to win the election. The winner of the election must secure strictly more votes than any other candidate. If two or more candidates receive the same .. 2020. 5. 27. CodeSignal [45/60] buildPalindrome Problem: Given a string, find the shortest possible string which can be achieved by adding characters to the end of initial string to make it a palindrome. Example For st = "abcdc", the output should be buildPalindrome(st) = "abcdcba". -Summary- 1. loop 을 돌며, i 부터 끝 index의 string이 palindrom 인지 아닌지를 확인한다. 2. 만약 palindrom이 아니라면 palindrom 이 나올때까지 search 한다. 3. palindrom substring을 만나면, nonPalindrom.. 2020. 5. 27. 이전 1 ··· 9 10 11 12 13 14 15 16 다음