본문 바로가기 메뉴 바로가기

Studying programming

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Studying programming

검색하기 폼
  • Jimin's Programming (194)
    • Algorithms (54)
    • JavaScript (16)
    • Vue.js (3)
    • Node.js (3)
    • React.js (7)
    • React Native (0)
    • Spring Boot (13)
    • JAVA (58)
    • C++ (17)
    • Programming (19)
    • Computer basics (4)
  • 방명록

remove duplicates using hashmap (1)
Equalize the Array

주어진 array 에서 최대로 중복되는 index를 제외한 나머지 index의 수를 구하는 문제 solution 1. 중복을 허용하지 않는 hashMap 을 선언. 2. 주어진 arr를 hashMap안에 넣으면서 중복되는 값이 있으면 value의 값이 1씩 증가하게 한다. 3. maximum value의 수를 찾는다. 4. 전체 array길이에서 찾아낸 maximum value를 return한다. Solution 1 -object를 이용하는 traditional way 말고 built-in function 인 Map을 이용하는 방식. function equalizeArray(arr) { //let arrObj = {}; //initialize object which is for hashmap. //but..

Algorithms 2020. 12. 11. 00:10
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • substring()
  • Javascript Algorithm
  • algorithm
  • equals()
  • 프로그래머스 알고리즘문제
  • spring boot application
  • rest parameter
  • C++
  • javascript
  • HackerRank Algorithm
  • math.abs
  • easy javascript algorithm
  • hackerrank solution
  • code refactoring
  • compareTo()
  • repeat()
  • math.max
  • 프로그래머스 알고리즘
  • hackerrank
  • java
  • hackerrank javascript
  • 알고리즘
  • 프로그래머스
  • easy algorithm
  • Object type casting
  • hackerrank javascript solution
  • Collection Framework
  • ... in Javascript
  • HashMap
  • string class in java
more
«   2025/06   »
일 월 화 수 목 금 토
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바