Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.You may assume that each inpu
Q) You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes co
Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range -231
Given an integer x, return true if x is palindrome integer.An integer is a palindrome when it reads the same backward as forward. For example, 121 is
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L
Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exam
Given a string s containing just the characters '(', ')', '{', '}', '' and '', determine if the input string is valid.An input string is valid if:Open
You probably know the "like" system from Facebook and other pages. People can "like" blog posts, pictures or other items. We want to create the text t
ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but exactly 4 digits or exactly 6 digits.If the function is passed a v
Jaden Smith, the son of Will Smith, is the star of films such as The Karate Kid (2010) and After Earth (2013). Jaden is also known for some of his phi
Your goal is to return multiplication table for number that is always an integer from 1 to 10.For example, a multiplication table (string) for number
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.Finish the solution s
Return the number (count) of vowels in the given string.We will consider a, e, i, o, u as vowels for this Kata (but not y).The input string will only
A Narcissistic Number is a positive number which is the sum of its own digits, each raised to the power of the number of digits in a given base. In th
Simple, given a string of words, return the length of the shortest word(s).String will never be empty and you do not need to account for different dat
An isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that contain
Write a function called “computeSquareRoot”. (“computeSquareRoot” 함수를 작성하세요.)Given a number, “computeSquareRoot” returns its square root. (숫자가 주어졌을때,
Count the number of divisors of a positive integer n. Random tests go up to n = 500000. Examples divisors(4) = 3 // 1, 2, 4 divisors(5) = 2 // 1
Deoxyribonucleic acid (DNA) is a chemical found in the nucleus of cells and carries the "instructions" for the development and functioning of living o
Given an array of integers, find the one that appears an odd number of times.There will always be only one integer that appears an odd number of times
Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Clari
Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if i
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example 1:Inpu
Given a string s consists of some words separated by spaces, return the length of the last word in the string. If the last word does not exist, return
덕분에 Number()의 최대 자리수와 BigInt의 계산법 까지 알게된 문제Given a non-empty array of decimal digits representing a non-negative integer, increment one to the integer
Q. Pete likes to bake some cakes. He has some recipes and ingredients. Unfortunately he is not good in maths. Can you help him to find out, how many c
Move the first letter of each word to the end of it, then add "ay" to the end of the word. Leave punctuation marks untouched.ExamplespigIt('Pig latin
Digital root is the recursive sum of all the digits in a number.Given n, take the sum of the digits of n. If that value has more than one digit, conti
Write a function that takes in a string of one or more words, and returns the same string, but with all five or more letter words reversed (like the n
This time no story, no theory. The examples below show you how to write function accum:Examples:accum("abcd") -> "A-Bb-Ccc-Dddd"accum("RqaEzty") -> "R
Trolls are attacking your comment section!A common way to deal with this situation is to remove all of the vowels from the trolls' comments, neutraliz
Count the number of DuplicatesWrite a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that o
Description:In this little assignment you are given a string of space separated numbers, and have to return the highest and lowest number.Example:high
Description:Write a function, persistence, that takes in a positive parameter num and returns its multiplicative persistence, which is the number of t
Description:In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n.
Write a function that accepts an array of 10 integers (between 0 and 9), that returns a string of those numbers in the form of a phone number.Example:
You are going to be given a word. Your job is to return the middle character of the word. If the word's length is odd, return the middle character. If
Welcome. In this kata, you are asked to square every digit of a number and concatenate them.For example, if we run 9119 through the function, 811181 w
Q. A square of squares You like building blocks. You especially like building blocks that are squares. And what you even like more, is to arrange them
Your task is to make a function that can take any non-negative integer as an argument and return it with its digits in descending order. Essentially,
Write a function that takes an integer as input, and returns the number of bits that are equal to one in the binary representation of that number. You
Your goal in this kata is to implement a difference function, which subtracts one list from another and returns the result.It should remove all values
Given two binary strings a and b, return their sum as a binary string.Example 1:Input: a = "11", b = "1"Output: "100"Example 2:Input: a = "1010", b =
Description:TaskYou are given two numbers a and b where 0 ≤ a ≤ b. Imagine you construct an array of all the integers from a to b inclusive. You need
Given a non-negative integer x, compute and return the square root of x.Since the return type is an integer, the decimal digits are truncated, and onl
Check to see if a string has the same amount of 'x's and 'o's. The method must return a boolean and be case insensitive. The string can contain any ch
Description:You are given an array (which will have a length of at least 3, but could be very large) containing integers. The array is either entirely
Description:You get an array of numbers, return the sum of all of the positives ones.Example 1,-4,7,12 => 1 + 7 + 12 = 20Note: if there is nothing to
In this kata you will create a function that takes a list of non-negative integers and strings and returns a new list with the strings filtered out.Ex
Description:In a factory a printer prints labels for boxes. For one kind of boxes the printer has to use colors which, for the sake of simplicity, are
Description:The goal of this exercise is to convert a string to a new string where each character in the new string is "(" if that character appears o
문제 설명수포자는 수학을 포기한 사람의 준말입니다. 수포자 삼인방은 모의고사에 수학 문제를 전부 찍으려 합니다. 수포자는 1번 문제부터 마지막 문제까지 다음과 같이 찍습니다.1번 수포자가 찍는 방식: 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, ...2번 수포
문제 설명프로그래머스 모바일은 개인정보 보호를 위해 고지서를 보낼 때 고객들의 전화번호의 일부를 가립니다.전화번호가 문자열 phone_number로 주어졌을 때, 전화번호의 뒷 4자리를 제외한 나머지 숫자를 전부 \*으로 가린 문자열을 리턴하는 함수, solution을
Given two integers a and b, which can be positive or negative, find the sum of all the integers between and including them and return it. If the two n
Description:Complete the square sum function so that it squares each number passed into it and then sums the results together.For example, for 1, 2, 2
Description:Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 positive integers. No floats or non-
Description:Usually when you buy something, you're asked whether your credit card number, phone number or answer to your most secret question is still
Description:You live in the city of Cartesia where all roads are laid out in a perfect grid. You arrived ten minutes too early to an appointment, so y
Welcome.In this kata you are required to, given a string, replace every letter with its position in the alphabet.If anything in the text isn't a lette
Description:Implement the function unique_in_order which takes as argument a sequence and returns a list of items without any elements with the same v
In a small town the population is p0 = 1000 at the beginning of a year. The population regularly increases by 2 percent per year and moreover 50 new i
Description:Polycarpus works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to ta
Description:Well met with Fibonacci bigger brother, AKA Tribonacci.As the name may already reveal, it works basically like a Fibonacci, but summing th
Description:Your task is to sort a given string. Each word in the string will contain a single number. This number is the position the word should hav
Description:Implement a method that accepts 3 integer values a, b, c. The method should return true if a triangle can be built with the sides of given
Take 2 strings s1 and s2 including only letters from ato z. Return a new sorted string, the longest possible, containing distinct letters - each taken
Description:You might know some pretty large perfect squares. But what about the NEXT one?Complete the findNextSquare method that finds the next integ
Description:Bob is preparing to pass IQ test. The most frequent task in this test is to find out which one of the given numbers differs from the other
Make a program that filters a list of strings and returns a list with only your friends name in it.If a name has exactly 4 letters in it, you can be s
Description:Complete the method/function so that it converts dash/underscore delimited words into camel casing. The first word within the output shoul
Description:Given the triangle of consecutive odd numbers:...Calculate the sum of the numbers in the nth row of this triangle (starting at index 1) e.
Description:Some numbers have funny properties. For example:89 --> 8¹ + 9² = 89 \* 1695 --> 6² + 9³ + 5⁴= 1390 = 695 \* 246288 --> 4³ + 6⁴+ 2⁵ + 8⁶ +
You are going to be given an array of integers. Your job is to take that array and find an index N where the sum of the integers to the left of N is e
마라톤에 참여한 선수들의 이름이 담긴 배열 participant와 완주한 선수들의 이름이 담긴 배열 completion이 주어질 때, 완주하지 못한 선수의 이름을 return 하도록 solution 함수를 작성해주세요.제한사항마라톤 경기에 참여한 선수의 수는 1명 이상
문제 설명길이가 n이고, "수박수박수박수...."와 같은 패턴을 유지하는 문자열을 리턴하는 함수, solution을 완성하세요. 예를들어 n이 4이면 "수박수박"을 리턴하고 3이라면 "수박수"를 리턴하면 됩니다.제한 조건n은 길이 10,000이하인 자연수입니다.입출력
문제 설명함수 solution은 정수 x와 자연수 n을 입력 받아, x부터 시작해 x씩 증가하는 숫자를 n개 지니는 리스트를 리턴해야 합니다. 다음 제한 조건을 보고, 조건을 만족하는 함수, solution을 완성해주세요.제한 조건x는 -10000000 이상, 1000
In this kata you have to write a simple Morse code decoder. While the Morse code is now mostly superseded by voice and digital data communication chan
Description:Given an array of ones and zeroes, convert the equivalent binary value to an integer.Eg: 0, 0, 0, 1 is treated as 0001 which is the binary
Write an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the other elements.moveZeros(false,1,0,1,2,0,1,3
Description:Write a function, which takes a non-negative integer (seconds) as input and returns the time in a human-readable format (HH:MM:SS)HH = hou
Description:A pangram is a sentence that contains every single letter of the alphabet at least once. For example, the sentence "The quick brown fox ju
Description:Given: an array containing hashes of namesReturn: a string formatted as a list of names separated by commas except for the last two names,
Description:Define a function that takes one integer argument and returns logical value true or false depending on if the integer is a prime.Per Wikip
Description:There is an array with some numbers. All numbers are equal except for one. Try to find it!findUniq( 1, 1, 1, 2, 1, 1 ) === 2findUniq( 0, 0
Description:Write a function that takes a string of parentheses, and determines if the order of the parentheses is valid. The function should return t
Complete the solution so that it splits the string into pairs of two characters. If the string contains an odd number of characters then it should rep
Given two arrays a and b write a function comp(a, b) (orcompSame(a, b)) that checks whether the two arrays have the "same" elements, with the same mul
Description:The rgb function is incomplete. Complete it so that passing in RGB decimal values will result in a hexadecimal representation being return
Description:What is an anagram? Well, two words are anagrams of each other if they both contain the same letters. For example:'abba' & 'baab' == true'
Write a method that takes an array of consecutive (increasing) letters as input and that returns the missing letter in the array.You will always get a
Description:Your task is to construct a building which will be a pile of n cubes. The cube at the bottom will have a volume of n^3, the cube above wil
Description:TaskYou will be given an array of numbers. You have to sort the odd numbers in ascending order while leaving the even numbers at their ori
Enough is enough!Alice and Bob were on a holiday. Both of them took many pictures of the places they've been, and now they want to show Charlie their
Given an array (arr) as an argument complete the function countSmileys that should return the total number of smiling faces.Rules for a smiling face:E
Description:Given two arrays of strings a1 and a2 return a sorted array r in lexicographical order of the strings of a1 which are substrings of string
Description:ROT13 is a simple letter substitution cipher that replaces a letter with the letter 13 letters after it in the alphabet. ROT13 is an examp
Description: The maximum sum subarray problem consists in finding the maximum sum of a contiguous subsequence in an array or list of integers: maxSeq
A child is playing with a ball on the nth floor of a tall building. The height of this floor, h, is known.He drops the ball out of the window. The bal
Description:Write a function that takes a string of braces, and determines if the order of the braces is valid. It should return true if the string is
Build TowerBuild Tower by the following given argument:number of floors (integer and always greater than 0).Tower block is represented as \*Python: re
Description:You are given an array(list) strarr of strings and an integer k. Your task is to return the first longest string consisting of k consecuti
Description:Given a string of words, you need to find the highest scoring word.Each letter of a word scores points according to its position in the al
Write Number in Expanded FormYou will be given a number and you will need to return it as a string in Expanded Form. For example:expandedForm(12); //
Description:The Fibonacci numbers are the numbers in the following integer sequence (Fn):0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, ...such as
제발 그만 까먹자 배열의 '' 을 지 울 땐 Array.filter(Boolean) !!!Description:The marketing team is spending way too much time typing in hashtags.Let's help them wit
Description:Complete the solution so that the function will break up camel casing, using a space between words.Example"camelCasing" => "camel Casing
The main idea is to count all the occurring characters in a string. If you have a string like aba, then the result should be {'a': 2, 'b': 1}.What if
Description:Write a function that when given a URL as a string, parses out just the domain name and returns it as a string. For example:domainName("ht
Write a function named first_non_repeating_letter that takes a string input, and returns the first character that is not repeated anywhere in the stri
문제 설명길이가 같은 두 1차원 정수 배열 a, b가 매개변수로 주어집니다. a와 b의 내적을 return 하도록 solution 함수를 완성해주세요.이때, a와 b의 내적은 a0b0 + a1b1 + ... + an-1\*bn-1 입니다. (n은 a, b의 길이)제한사
Description:Write a program that will calculate the number of trailing zeros in a factorial of a given number.N! = 1 2 3 ... NBe careful 1000! has
Q. A)
다섯 자리의 정수 1개를 입력받아 각 자리별로 나누어 출력한다.참고scanf("%1d%1d%1d%1d%1d", &a, &b, &c, &d, &e);를 사용하면 1개의 숫자로 각각 구분되어 저장된다.예시읽어들인 값을 적당히 바꿔 출력하기 위해서printf("%d", a\
TaskGiven three integers a ,b ,c, return the largest number obtained after inserting the following operators and brackets: +, , ()In other words , try
altERnaTIng cAsE <=> ALTerNAtiNG CaSeDefine String.prototype.toAlternatingCase (or a similar function/method such as to_alternating_case/toAlternat
Your start-up's BA has told marketing that your website has a large audience in Scandinavia and surrounding countries. Marketing thinks it would be gr
The cockroach is one of the fastest insects. Write a function which takes its speed in km per hour and returns it in cm per second, rounded down to th
Write a function named setAlarm which receives two parameters. The first parameter, employed, is true whenever you are employed and the second paramet
Sentence SmashWrite a function that takes an array of words and smashes them together into a sentence and returns the sentence. You can ignore any nee
Q. 배열 array의 i번째 숫자부터 j번째 숫자까지 자르고 정렬했을 때, k번째에 있는 수를 구하려 합니다. 예를 들어 array가 [1, 5, 2, 6, 3, 7, 4], i = 2, j = 5, k = 3이라면 array의 2번째부터 5번째까지 자르면 [5
Q. 두 정수 left와 right가 매개변수로 주어집니다. left부터 right까지의 모든 수들 중에서, 약수의 개수가 짝수인 수는 더하고, 약수의 개수가 홀수인 수는 뺀 수를 return 하도록 solution 함수를 완성해주세요. 제한사항 1 ≤ left ≤
Q. Usually when you buy something, you're asked whether your credit card number, phone number or answer to your most secret question is still correct.
오랜만에 4kyu문제 풀려니까 좀 오래걸린다. 뇌를 더 굴려야지...!!!!
Q. 단어 s의 가운데 글자를 반환하는 함수, solution을 만들어 보세요. 단어의 길이가 짝수라면 가운데 두글자를 반환하면 됩니다. 재한사항 s는 길이가 1 이상, 100이하인 스트링입니다. 입출력 예 s return "abcde" "c" "qwer" "we" A)
replaceAll을 쓸 수 있으면 훨씬 짧아질텐데 왜 지원을 안해주지!!?