목록알고리즘/풀이 (181)
규도자 개발 블로그
Objective Today, we're building on our knowledge of Arrays by adding another dimension. Check out the Tutorial tab for learning materials and an instructional video!Context Given a 2D Array, :1 1 1 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 We define an hourglass in to be a subset of values with indices falling in this pattern in 's graphical representation:a b c d e f g T..
[백준/9012/파이썬(python3)] 괄호 문제 괄호 문자열(Parenthesis String, PS)은 두 개의 괄호 기호인 ‘(’ 와 ‘)’ 만으로 구성되어 있는 문자열이다. 그 중에서 괄호의 모양이 바르게 구성된 문자열을 올바른 괄호 문자열(Valid PS, VPS)이라고 부른다. 한 쌍의 괄호 기호로 된 “( )” 문자열은 기본 VPS 이라고 부른다. 만일 x 가 VPS 라면 이것을 하나의 괄호에 넣은 새로운 문자열 “(x)”도 VPS 가 된다. 그리고 두 VPS x 와 y를 접합(concatenation)시킨 새로운 문자열 xy도 VPS 가 된다. 예를 들어 “(())()”와 “((()))” 는 VPS 이지만 “(()(”, “(())()))” , 그리고 “(()” 는 모두 VPS 가 아닌 문..
Objective Today, we're working with binary numbers. Check out the Tutorial tab for learning materials and an instructional video!Task Given a base- integer, , convert it to binary (base-). Then find and print the base- integer denoting the maximum number of consecutive 's in 's binary representation.Input FormatA single integer, .ConstraintsOutput FormatPrint a single base- integer denoting the ..
Objective Today, we're learning and practicing an algorithmic concept called Recursion. Check out the Tutorial tab for learning materials and an instructional video!Recursive Method for Calculating Factorial Task Write a factorial function that takes a positive integer, as a parameter and prints the result of ( factorial).Note: If you fail to use recursion or fail to name your recursive function..
Objective Today, we're learning about Key-Value pair mappings using a Map or Dictionary data structure. Check out the Tutorial tab for learning materials and an instructional video!Task Given names and phone numbers, assemble a phone book that maps friends' names to their respective phone numbers. You will then be given an unknown number of names to query your phone book for. For each queried, p..
Objective Today, we're learning about the Array data structure. Check out the Tutorial tab for learning materials and an instructional video!Task Given an array, , of integers, print 's elements in reverse order as a single line of space-separated numbers.Input FormatThe first line contains an integer, (the size of our array). The second line contains space-separated integers describing array 's..
Objective Today we're expanding our knowledge of Strings and combining it with what we've already learned about loops. Check out the Tutorial tab for learning materials and an instructional video!Task Given a string, , of length that is indexed from to , print its even-indexed and odd-indexed characters as space-separated strings on a single line (see the Sample below for more detail).Note: is c..
Objective In this challenge, we're going to use loops to help us do some simple math. Check out the Tutorial tab to learn more.Task Given an integer, , print its first multiples. Each multiple (where ) should be printed on a new line in the form: n x i = result.Input FormatA single integer, .ConstraintsOutput FormatPrint lines of output; each line (where ) contains the of in the form: n x i = re..
Objective In this challenge, we're going to learn about the difference between a class and an instance; because this is an Object Orientedconcept, it's only enabled in certain languages. Check out the Tutorial tab for learning materials and an instructional video!Task Write a Person class with an instance variable, , and a constructor that takes an integer, , as a parameter. The constructor must..
Objective In this challenge, we're getting started with conditional statements. Check out the Tutorial tab for learning materials and an instructional video!Task Given an integer, , perform the following conditional actions:If is odd, print WeirdIf is even and in the inclusive range of to , print Not WeirdIf is even and in the inclusive range of to , print WeirdIf is even and greater than , prin..