Skip to content

seoulboy/algorithm.log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

497 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

알고리즘에 관한 잡담

알고리즘 문제 풀이를 시작한 이후로 세상만사가 알고리즘 풀이 과정으로 보이게 됬다. 디자인 패턴 공부할 때도 세상 모든 것이 디자인 패턴으로 보였는데, 비슷한 증상인 듯하다.

작년에 웹개발을 공부하던 때는 자바스크립트로 풀이를 했고, 현재 2021년에는 iOS 개발을 공부하면서 스위프트로 풀이를 진행하고 있다.

지금 보니 이곳에 기록하지 않은 알고리즘 문제 풀이가 상당히 많다. 이제부터는 조금 더 착실하게 알고리즘 문제 풀이를 기록해보려고 한다.

현재는 CodeWars라는 알고리즘 풀이 플랫폼에서 기초를 다지고 있고, 추후에는 LeetCode 혹은 프로그래머스의 문제들도 풀고 기록할 계획이다.

최근에 본 책에서 읽은 구절이 생각난다. "음악가가 스케일을 연습하는 것과 같이 프로그래머는 알고리즘 문제 풀이를 연습한다"고.

실력있는 프로그래머가 되려면 알고리즘 작성 연습을 꾸준히 해야한다는 말인 것 같다.

다행히도 나는 알고리즘 풀이를 어느정도는 즐기는 편이기 때문에 지속할 수 있는 취미로 삼을 수 있을 것 같다.

내가 작성한 알고리즘이 최고의 알고리즘일 필요는 없다.

지금은 알고리즘 문제를 하나씩 풀이하면서 배운점과 느낀점을 기록해보는데 집중하자.

Tips

알고리즘을 작성하다가 문법이나 API가 떠오르지 않을때는 코드를 플레이그라운드에서 작성한다.

만약 코딩 문제풀이 혹은 코딩테스트 플랫폼이 복사 및 붙여넣기를 지원하지 않는다면 꽤나 번거롭겠지만, 필요에 따라 사용했을 때 매우 편리했다.

코딩테스트 플랫폼이나 문제풀이 웹사이트의 IDE는 xcode와는 다르게 intellisense 가 탑재되어 있지 않기 때문에 스위프트의 길고 다양한 메서드를 모두 외우기 전까지는 좋은 방법인 것 같다.

Useful APIs (Swift)

Hacks (Swift)

CodeSnippets (Swift)

HackerRank 🏰

Swift 🐦

#1 Heaps: Find the Running Median

CodeWars ⚔️

Swift 🦅

8kyu
7kyu

#1 binary_calculator
#2 lost_number_in_number_sequence
#3 partial_word_searching
#4 euclidean_distance_in_n_dimensions
#5 fizz_buzz_cuckoo_clock
#6 balanced_number
#7 alphabetical_addition
#8 linked_lists_move_node
#9 resistor_color_codes
#10 sum_of_integers_in_string
#11 find_the_nth_digit_of_a_number.swift
#12 circle_of_numbers.swift
#13 replace_all_items.swift
#14 jumping_number.swift
#15 sum_of_angles.swift
#16 count_the_digit.swift
#17 sum_of_all_the_multiples_of_3_or_5 #18 special_number_series_5 #19 find_all_non_consecutive_numbers #20 sort_out_the_men_from_boys #21 disarium_number_special_numbers_series_3 #22 extra_perfect_numbers_special_numbers_series_7 #23 toleetspeak #24 linked_lists_get_nth_node #25 linked_lists_push_build_onetwothree #26 counting_in_the_amazon #27 easy_wallpaper #28 moves_in_squared_strings_I #29 going_to_the_cinema #30 correct_the_time-string

6kyu

#1 unique_substring_from_joined_strings
#2 linked_lists_remove_duplicates
#3 basic_encryption
#4 linked_lists_insert_nth_node
#5 n-back #6 moves_in_squared_string_IV #7 linked_lists_iterative_reverse #8 good_vs_evil

JavaScript 🕸

8kyu

#1 multiply
#2 total_amount_of_points
#3 opposite_number
#4 welcome
#5 function_1_hello_world
#6 find_numbers_which_are_divisible_by_given_number
#7 even_or_odd
#8 sum_of_positive
#9 string_repeat
#10 remove_first_and_last_character
#11 return_negative
#12 find_the_smallest_integer_in_the_array
#13 remove_string_spaces
#14 counting_sheep
#15 basic_mathematical_operations
#16 grasshopper_summation
#17 convert_boolean_value_to_strings_yes_or_no
#18 convert_a_number_to_a_string
#19 count_of_positive_sum_of_negatives
#20 sum_without_highest_and_lowest_number
#21 convert_number_to_reversed_array_of_digits
#22 a_needle_in_the_haystack
#23 jenny's_secret_message
#24 keep_hydrated
#25 calculate_average
#26 is_n_divisible_by_x_and_y
#27 century_from_year
#28 reversed_strings
#29 find_maximum_and_minimum_values_of_a_list
#30 rock_paper_scissors
#31 invert_values
#32 fake_binary
#33 square_n_sum
#34 double_char
#35 abbreviate_a_two_word_name
#36 reversed_sequence
#44 do_i_get_a_bonus
#46 dna_to_rna_conversion
#47 alternating_case
#48 convert_string_to_a_number
#49 you_only_need_one_beginner
#51 transportation_on_vacation
#52 remove_exclamation_marks
#53 are_you_playing_banjo
#55 to_square_or_not_to_square #57 the_feast_of_many_beasts

7kyu

#37 rithm_series_frame_a_phrase_simple
#38 mumbling
#39 get_the_middle_character
#40 vowel_count
#41 highest_and_lowest
#42 shortest_word
#43 complementary_dna
#45 descending_order
#50 exes_and_ohs
#54 jaden_casing_strings
#56 square_every_digit

LeetCode Topics

Array

0001-two-sum
0026-remove-duplicates-from-sorted-array
0027-remove-element
0035-search-insert-position
0036-valid-sudoku
0048-rotate-image
0066-plus-one
0074-search-a-2d-matrix
0088-merge-sorted-array
0118-pascals-triangle
0136-single-number
0162-find-peak-element
0169-majority-element
0189-rotate-array
0204-count-primes
0209-minimum-size-subarray-sum
0215-kth-largest-element-in-an-array
0283-move-zeroes
0350-intersection-of-two-arrays-ii
0792-binary-search
1786-count-the-number-of-consistent-strings
2308-divide-array-into-equal-pairs
2478-longest-nice-subarray

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0013-roman-to-integer
0036-valid-sudoku
0169-majority-element
0242-valid-anagram
0350-intersection-of-two-arrays-ii
0387-first-unique-character-in-a-string
1786-count-the-number-of-consistent-strings
2308-divide-array-into-equal-pairs

Bit Manipulation

0067-add-binary
0136-single-number
0190-reverse-bits
1786-count-the-number-of-consistent-strings
2308-divide-array-into-equal-pairs
2478-longest-nice-subarray

Counting

0169-majority-element
0387-first-unique-character-in-a-string
1786-count-the-number-of-consistent-strings
2308-divide-array-into-equal-pairs

Stack

0094-binary-tree-inorder-traversal

Tree

0094-binary-tree-inorder-traversal
0783-search-in-a-binary-search-tree

Depth-First Search

0094-binary-tree-inorder-traversal

Binary Tree

0094-binary-tree-inorder-traversal
0783-search-in-a-binary-search-tree

Linked List

0083-remove-duplicates-from-sorted-list

Math

0009-palindrome-number
0013-roman-to-integer
0048-rotate-image
0066-plus-one
0067-add-binary
0070-climbing-stairs
0189-rotate-array
0204-count-primes

String

0003-longest-substring-without-repeating-characters
0013-roman-to-integer
0028-find-the-index-of-the-first-occurrence-in-a-string
0058-length-of-last-word
0067-add-binary
0125-valid-palindrome
0242-valid-anagram
0387-first-unique-character-in-a-string
1786-count-the-number-of-consistent-strings

Binary Search

0035-search-insert-position
0074-search-a-2d-matrix
0162-find-peak-element
0209-minimum-size-subarray-sum
0350-intersection-of-two-arrays-ii
0792-binary-search

Simulation

0067-add-binary

Divide and Conquer

0169-majority-element
0190-reverse-bits
0215-kth-largest-element-in-an-array

Sorting

0088-merge-sorted-array
0169-majority-element
0215-kth-largest-element-in-an-array
0242-valid-anagram
0350-intersection-of-two-arrays-ii

Heap (Priority Queue)

0215-kth-largest-element-in-an-array

Quickselect

0215-kth-largest-element-in-an-array

Matrix

0036-valid-sudoku
0048-rotate-image
0074-search-a-2d-matrix

Binary Search Tree

0783-search-in-a-binary-search-tree

Sliding Window

0003-longest-substring-without-repeating-characters
0209-minimum-size-subarray-sum
2478-longest-nice-subarray

Two Pointers

0026-remove-duplicates-from-sorted-array
0027-remove-element
0028-find-the-index-of-the-first-occurrence-in-a-string
0088-merge-sorted-array
0125-valid-palindrome
0189-rotate-array
0283-move-zeroes
0350-intersection-of-two-arrays-ii

Design

0969-number-of-recent-calls

Queue

0387-first-unique-character-in-a-string
0969-number-of-recent-calls

Data Stream

0969-number-of-recent-calls

Prefix Sum

0209-minimum-size-subarray-sum

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string

Enumeration

0204-count-primes

Number Theory

0204-count-primes

Dynamic Programming

0070-climbing-stairs
0118-pascals-triangle

Memoization

0070-climbing-stairs

About

my problem solving journey, mainly on Leetcode

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors