본문 바로가기

카테고리 없음

2020-12-05 22시 개발자 글 모음 | "[leetCode] 744. Find" 외 1개 이야기

Union-Find Algorithm by 편해걸 about Algorithm

  • push ( i ); } function find ( x ) { if ( x === p [ x ]) { return x ; } else { return find ( p [ x ]); } } function union ( x
  • y ) { x = find ( x ); y = find ( y ); if ( x < y ) p [ y ] = x ; else p [ x ] = y ; } union ( 0
  • function find ( x ) { if ( x === p [ x ]) { return x ; } else { return p [ x ] = find ( p [ x ]); } }


[leetCode] 744. Find Smallest Letter Greater Than Target (Python) by 장동현 about Python

  • "j"] target = "a" Output: "c" Input: letters = ["c"
  • "j"] target = "c" Output: "f" Input: letters = ["c"
  • "j"] target = "d" Output: "f" Input: letters = ["c"