목록2021/06/15 (2)
잡다한 IT 지식
링크 Merge Strings Alternately - 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 번갈아가면서 문자열합치기. [내가 푼 코드] class Solution { public String mergeAlternately(String word1, String word2) { String longerStr = word1.length() > word2.length() ? word1 :word2; String shortStr = longerStr == wo..
링크 Height Checker - 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 정렬되지 않은 학생들이 있습니다. 학생들을 키순으로 정렬했을 때와 정렬하지 않았을 때를 비교했을 때 잘못 선 학생의 수를 구하시오. [내가 푼 코드] import java.util.Arrays; class Solution { public int heightChecker(int[] heights) { int answer = 0; //줄을 순서대로 서지 않은 학생 배열을 복사한 배열...