Link - Baekjoon Online Algorithm JudgePattern printing is often used as a practice to get oneself used to the very basics of coding. (i.e - \_for-loop
Link : Leetcode Two SumGiven an array of integers, return indices of the two numbers such that they add up to a specific target. (You may assume that
The sieve of Eratosthenes is an ancient algorithm for finding all the prime numbers to the given limit by excluding the multiples of the prime numbers
Baekjoon - 6219 : Prime Number QualificationThe problem to be solved on this post is an application of the algorithm explained in the previous post -
a computational algorithms that rely on repeated random samplings to obtain numerical results. Monte Carlo Simulation is often used to estimate the va
Leetcode : Climbing StairsYou are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how man
Leetcode : Factorial Trailing ZerosGiven an integer n, return the number of trailing zeroes in n!Example 1InputOutputExample 2InputOutputTrailing Zero
Leetcode : Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.Example 1Input
Leetcode : Pascal's Triangle IIGiven an integer rowIndex, return the rowIndexth row of the Pascal's triangle.Example 1 InputOutputExample 2InputOutput
Baekjoon - 9095 : Sum of 1, 2, 3Each time you can either climb 1, 2, or 3 steps. In how many distinct ways can you add up to the input - n?ExampleInpu
Leetcode : Median of Two Sorted ArraysGiven two sorted arrays nums1 and nums2 of size m and n respectively. Return the median of the two sorted arrays
LeetCode : ZigZag ConversionThe string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like thisAnd then read line by line:
Baekjoon : Sum of Numbers 2Given an array A of size N , return the number of cases in which A's i-th index to j-th index (i.e - Ai+Ai+1+…+Aj-1+Aj) equ
Baekjoon : Climbing StairsGiven a stair S with a point on each floor, return the maximum score after climbing to the top of the stairs.Rule of the Gam
Leetcode : Combining Two SolutionsPH Solution's PH value is represented in positive integer ranging from 1 - 1,000,000,000. While the Alkaline solutio
Baekjoon : Integer TriangleFigure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that starts
Baekjoon : Goldbach's ConjectureVerify Goldbach's conjecture for all even numbers less than a million.Goldbach's Conjecture"Every even number greater
Baekjoon : Seats in TheaterThere is theater with seats in one line ranging from 1 to N. Audience must take a seat according the number on the ticket.
Leetcode : Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree 1
Leetcode : Integer to RomanRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Given an integer, convert it to a roman n
Leetcode : Roman to IntegerRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Given a roman numeral, convert it to an i
Leetcode : Longest Substring Without Repeating CharactersGiven a string s, find the length of the longest substring without repeating characters.Examp
Leetcode : 3SumGiven an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array wh
Leetcode : Merge Sorted ArrayGiven two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.ExampleInputOutputUse two poi
Leetcode : String to Integer (atoi)Implement atoi which converts a string to an integer.ConstraintsOnly the space character ' ' is considered a whites
Leetcode : Pow(x,n)DescriptionImplement pow(x, n), which calculates x raised to the power n (i.e. xn).Constraints\-100.0 < x < 100.0\-231 <=
Leetcode : Container With Most WaterGiven n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical li
Leetcode : 3Sum ClosestGiven an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Re
Leetcode : Maximum Product SubarrayGiven an integer array nums, find the contiguous subarray within an array (containing at least one number) which ha
Leetcode : Basic Calculator IIDescriptionGiven a string s which represents an expression, evaluate this expression and return its value. The integer d
Leetcode : Spiral MatrixDescriptionGiven an m x n matrix, return all elements of the matrix in spiral order.Example 1InputOutputExample 2 InputOutputA
Leetcode : Word LadderDescriptionGiven two words beginWord and endWord, and a dictionary wordList, return the length of the shortest transformation se
Minimum Operations to Reduce X to ZeroDescriptionYou are given an integer array nums and an integer x. In one operation, you can either remove the lef
Leetcode : Max Number of K-Sum PairsDescriptionYou are given an integer array nums and an integer k. In one operation, you can pick two numbers from t