https://leetcode.com/problems/merge-two-sorted-lists/ Merge Two Sorted Lists - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 연결리스트 (linked list) 문제를 처음 접해봐서 discuss 참고함 배열과의 차이점을 꼭 알아두고, 언제 활용해야될지 생각해야될듯.. package main type ListNode struct { Val int Next *ListNode } func main() {..
https://leetcode.com/problems/contains-duplicate/ Contains Duplicate - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com package main func main() { nums := []int{1, 2, 3, 1} // nums := []int{1, 2, 3, 4} containsDuplicate(nums) } // 제출 코드 func containsDuplicate(nums []int) bool { intM..
https://leetcode.com/problems/rotate-string/ Rotate String - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com package main import "strings" func main() { s := "abcde" goal := "cdeab" rotateString(s, goal) } //제출 코드 func rotateString(s string, goal string) bool { if len(s) != len(goa..
https://leetcode.com/problems/single-number/ Single Number - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com package main func main() { nums := []int{2, 2, 1} // nums := []int{4,1,2,1,2} // nums := []int{1} singleNumber(nums) } // 제출 코드 func singleNumber(nums []int) int { result :=..
https://leetcode.com/problems/majority-element/ Majority Element - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com package main func main() { // nums := []int{3, 2, 3} nums := []int{2, 2, 1, 1, 1, 2, 2} majorityElement(nums) } // 제출 코드 func majorityElement(nums []int) int { numsMap..
https://leetcode.com/problems/maximum-number-of-words-you-can-type/ Maximum Number of Words You Can Type - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com package main import ( "strings" ) func main() { text := "leet code" brokenLetters := "lt" canBeTypedWords(text, brokenLetters) ..
https://leetcode.com/problems/final-value-of-variable-after-performing-operations/ Final Value of Variable After Performing Operations - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com package main import ( "strings" ) func main() { operations := []string{"--X", "X++", "X++"} final..
https://leetcode.com/problems/consecutive-characters/ Consecutive Characters - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com package main func main() { s := "j" // s = "abbcccddddeeeeedcba" // s = "triplepillooooow" // s = "hooraaaaaaaaaaay" maxPower(s) } // 제출 코드 func maxPower(s..