Leetcode#4_ZigZag Convention_05wk02 by SOMJANG 포스팅 썸네일 이미지

우리가 공부한 것 들/알고리즘

Leetcode#4_ZigZag Convention_05wk02 by SOMJANG

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I I G Y I R And then read line by line: "PAHNAPLSIIGYIR" Write the code that will take a string and make this conversion given a number of rows: string convert(string s, int numRows); Example 1: Input: s = "PA..

2020.05.13 게시됨

Leetcode#3_Longest Substring Without Repeating Characters _05wk01 by SOMJANG 포스팅 썸네일 이미지

우리가 공부한 것 들/알고리즘

Leetcode#3_Longest Substring Without Repeating Characters _05wk01 by SOMJANG

Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2: Input: "bbbbb" Output: 1 Explanation: The answer is "b", with the length of 1. Example 3: Input: "pwwkew" Output: 3 Explanation: The answer is "wke", with the length of 3. Note that the answer must be a su..

2020.05.11 게시됨

Leetcode#1_Reverse Integer_02w03 by SOMJANG 포스팅 썸네일 이미지

우리가 공부한 것 들/알고리즘

Leetcode#1_Reverse Integer_02w03 by SOMJANG

Given a 32-bit signed integer, reverse digits of an integer. Example 1 Input: 123 Output: 321 Example 2 Input: -123 Output: -321 Example 3 Input: 120 Output: 21 Note: Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [−231, 231 − 1]. For the purpose of this problem, assume that your function returns 0 when the reversed integer overf..

2020.02.20 게시됨