DataSicence & AI
close
프로필 배경
프로필 로고

DataSicence & AI

  • 분류 전체보기 (26)
    • Data Science (0)
      • AI (0)
      • Statistic (0)
    • Computer Science (7)
      • Development (1)
      • Problem Solve (6)
    • Obsidian (0)
    • Courses (16)
      • CS229 (16)
    • Paper (2)
  • 홈
  • 태그
  • 방명록
[LeetCode] 670: Maximum Swap

[LeetCode] 670: Maximum Swap

문제문제 링크 : 670: Maximum SwapYou are given an integer num. You can swap two digits at most once to get the maximum valued number.Return the maximum valued number you can get. Example 1:Input: num = 2736Output: 7236Explanation: Swap the number 2 and the number 7. Example 2:Input: num = 9973Output: 9973Explanation: No swap. Constraints:0 풀이class Solution {public: int maximumSwap(int num) { ..

  • format_list_bulleted Computer Science/Problem Solve
  • · 2024. 10. 17.
  • textsms

[BOJ] 1874: 스택수열 (C++)

문제스택 (stack)은 기본적인 자료구조 중 하나로, 컴퓨터 프로그램을 작성할 때 자주 이용되는 개념이다. 스택은 자료를 넣는 (push) 입구와 자료를 뽑는 (pop) 입구가 같아 제일 나중에 들어간 자료가 제일 먼저 나오는 (LIFO, Last in First out) 특성을 가지고 있다.1부터 n까지의 수를 스택에 넣었다가 뽑아 늘어놓음으로써, 하나의 수열을 만들 수 있다. 이때, 스택에 push하는 순서는 반드시 오름차순을 지키도록 한다고 하자. 임의의 수열이 주어졌을 때 스택을 이용해 그 수열을 만들 수 있는지 없는지, 있다면 어떤 순서로 push와 pop 연산을 수행해야 하는지를 알아낼 수 있다. 이를 계산하는 프로그램을 작성하라.입력첫 줄에 n (1 ≤ n ≤ 100,000)이 주어진다. ..

  • format_list_bulleted Computer Science/Problem Solve
  • · 2024. 5. 5.
  • textsms
  • navigate_before
  • 1
  • navigate_next
공지사항
전체 카테고리
  • 분류 전체보기 (26)
    • Data Science (0)
      • AI (0)
      • Statistic (0)
    • Computer Science (7)
      • Development (1)
      • Problem Solve (6)
    • Obsidian (0)
    • Courses (16)
      • CS229 (16)
    • Paper (2)
최근 글
인기 글
최근 댓글
태그
  • #llm
  • #lecture
  • #네이버 카페 API
  • #백준
  • #ML
  • #cs229
  • #leetcode
  • #우선순위 큐
  • #ps
  • #SGG
전체 방문자
오늘
어제
전체
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바