본문 바로가기

Tech for good

검색하기
Tech for good
프로필사진 Diana Kang

  • All (178)
    • Profile (2)
    • IT (164)
      • Data Science (38)
      • Computer Science (105)
      • Cloud (20)
    • Book & Article (11)
Guestbook
Notice
Recent Posts
Recent Comments
Link
  • Github
«   2025/05   »
일 월 화 수 목 금 토
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 31
Tags
  • 파이썬
  • two-pointer
  • gcp
  • stratascratch
  • array
  • GenerativeAI
  • heap
  • 니트코드
  • 코드업
  • nlp
  • 릿코드
  • Stack
  • 파이썬기초100제
  • 생성형AI
  • dfs
  • 파이썬알고리즘
  • 자연어처리
  • sql코테
  • 리트코드
  • codeup
  • GenAI
  • 투포인터
  • Python3
  • slidingwindow
  • Greedy
  • Python
  • SQL
  • LeetCode
  • 슬라이딩윈도우
  • 알고리즘
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록2025/05/26 (1)

Tech for good

[Leetcode/Array, Greedy, Sorting] 2037. Minimum Number of Moves to Seat Everyone

class Solution: def minMovesToSeat(self, seats: List[int], students: List[int]) -> int: students.sort(reverse=True) seats.sort(reverse=True) minMove = 0 for i in range(len(students)): minMove += abs(students[i] - seats[i]) return minMove✅ Why Use abs() (Absolute Value)?The problem asks for the total number of moves to align each student with a sea..

IT/Computer Science 2025. 5. 26. 22:42
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바