코딩테스트

    [LeetCode] 819. Most Common Word

    https://leetcode.com/problems/most-common-word/ Most Common Word - 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 banned 목록에 없는 단어 중 가장 많이 반복된 단어 return String 구현 문제(?)인데, 난 이런 문제는 꼭 Map을 쓰고 싶더라 (아주 제격이다) class Solution { public String mostCommonWord(String paragraph, String[] ban..

    [LeetCode] 460. LFU Cache

    https://leetcode.com/problems/lfu-cache/description/ LFU Cache - 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 key, value 값을 저장해야해서 map을 사용해야겠다고 생각했다. 그래서, key, value 저장 map 하나와 key, user counter를 저장 할 map을 각각 선언해서 풀려고 했는데, 일부 테스트케이스에서 막힌다. class LFUCache { private Map cache; // ..

    [프로그래머스] [카카오 인턴] 크레인 인형뽑기 게임

    programmers.co.kr/learn/courses/30/lessons/64061 코딩테스트 연습 - 크레인 인형뽑기 게임 [[0,0,0,0,0],[0,0,1,0,3],[0,2,5,0,1],[4,2,4,4,2],[3,5,1,3,1]] [1,5,3,5,1,2,1,4] 4 programmers.co.kr 30분안에는 못풀었지만, 수빈이가 말한거에서 힌트 얻어서 푼 문제 ㅋㅋ 이미 넣은 숫자를 어떻게 피해갈지 고민해서 visit을 표시하려고, 클래스도 만들어보고 했다가 수빈이가 0으로 초기화한다는 얘기를 해서 '아..그러면 되겠구나..'하고 바로 후루룩 풀수 있었다. 수빈 감사..🙇‍♀️ import java.util.*; class Solution { public int solution(int[][] ..

    [프로그래머스] [카카오 인턴] 키패드 누르기

    tech.kakao.com/2020/07/01/2020-internship-test/ 2020 카카오 인턴십 for Tech developers 문제해설 2020년 카카오의 여름 인턴십이 시작 되었습니다.여름 인턴십의 첫번째 관문인 코딩 테스트가 2020년 5월 9일 오후 2시부터 6시까지 진행되었는데요, 온라인으로 진행되었기 때문에 코로나19로부터 tech.kakao.com 풀이 class Solution { class Position{ int x; int y; Position(){} Position(int x, int y){ this.x = x; this.y = y; } } private int [][] position = {{1,2,3},{4,5,6},{7,8,9},{11,0,99}}; public..