전체 글(368)
-
[프로그래머스/Kotlin]Lv3 - 네트워크
프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 문제 설명 네트워크란 컴퓨터 상호 간에 정보를 교환할 수 있도록 연결된 형태를 의미합니다. 예를 들어, 컴퓨터 A와 컴퓨터 B가 직접적으로 연결되어있고, 컴퓨터 B와 컴퓨터 C가 직접적으로 연결되어 있을 때 컴퓨터 A와 컴퓨터 C도 간접적으로 연결되어 정보를 교환할 수 있습니다. 따라서 컴퓨터 A, B, C는 모두 같은 네트워크 상에 있다고 할 수 있습니다. 컴퓨터의 개수 n, 연결에 대한 정보가 담긴 2차원 배열 computers가 매개변수로 주어질 때, 네트워크의 개수를 return 하도록 solut..
2023.07.16 -
[LeetCode/Kotlin]Easy - 392. Is Subsequence
Is Subsequence - LeetCode Can you solve this real interview question? Is Subsequence - Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is formed from the original string by deleting some (can be n leetcode.com 문제 Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequenc..
2023.07.07 -
[LeetCode/Kotlin]Medium - 22. Generate Parentheses
Generate Parentheses - LeetCode Can you solve this real interview question? Generate Parentheses - Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example 1: Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"] Exa leetcode.com 문제 Given n pairs of parentheses, write a function to generate all combinations of well-formed paren..
2023.07.07 -
[LeetCode/Kotlin]Medium - 1027. Longest Arithmetic Subsequence
Longest Arithmetic Subsequence - LeetCode Can you solve this real interview question? Longest Arithmetic Subsequence - Given an array nums of integers, return the length of the longest arithmetic subsequence in nums. Note that: * A subsequence is an array that can be derived from another array by leetcode.com 문제 Given an array nums of integers, return the length of the longest arithmetic subsequ..
2023.06.30 -
[LeetCode/Kotlin]Easy - 58. Length of Last Word
Length of Last Word - LeetCode Can you solve this real interview question? Length of Last Word - Given a string s consisting of words and spaces, return the length of the last word in the string. A word is a maximal substring consisting of non-space characters only. Example 1: Input: leetcode.com 문제 Given a string s consisting of words and spaces, return the length of the last word in the string..
2023.06.30 -
[LeetCode/Kotlin]Easy - 1356. Sort Integers by The Number of 1 Bits
Sort Integers by The Number of 1 Bits - LeetCode Can you solve this real interview question? Sort Integers by The Number of 1 Bits - You are given an integer array arr. Sort the integers in the array in ascending order by the number of 1's in their binary representation and in case of two or more integ leetcode.com 문제 You are given an integer array arr. Sort the integers in the array in ascendin..
2023.06.30