평생공부하는사람

  • 홈
  • 태그
  • 방명록

후행 클로져 1

[프로그래머스] 문자열 내 p와 y의 개수, 문자열 내림차순으로 배치하기, 문자열 다루기 기본 with Swift

안녕하세요! 오늘은 프로그래머스 문자열 내 p와 y의 개수, 문자열 내림차순으로 배치하기, 문자열 다루기 기본 세문제를 풀어보았습니다! 1. 문자열 내 p와 y의 개수 문자열 내 p, P, y, Y의 개수를 비교하는 문제입니다. String[String.index(String.startIndex, offsetBy: index)]를 이용해 문자열의 한글자씩 가져올 수 있습니다. 이를 통해 P와 p 그리고 Y와 y의 개수를 counting해 같으면 true 다르면 false를 리턴해주면 됩니다! import Foundation func solution(_ s:String) -> Bool { var ans:Bool = false var count = s.count var pCount = 0, yCount = ..

Algorithm Problem Solving/Programmers 2021.12.06
이전
1
다음
더보기
프로필사진

평생공부하는사람

영상처리 프로그래밍, 알고리즘, iOS 프로그래밍등 다양한 프로그래밍 관련주제로 매일 매일 공부하는 블로그입니다!

  • 분류 전체보기 (68)
    • 수학 및 공학 (0)
      • Probabilities and Statistic.. (0)
      • Digital Signal Processing (0)
      • Image Signal Processing (0)
    • Skill Sets (7)
      • C (0)
      • C++ (1)
      • Python (0)
      • Swift (6)
    • Computer Science (1)
      • Operating System (1)
      • Computer Architecture (0)
      • Design Pattern (0)
    • Computing Skills (4)
      • Data Structure (3)
      • Algorithm (1)
      • GPU programming (0)
      • Artificial Intelligence (0)
    • Algorithm Problem Solving (54)
      • Programmers (54)
    • Paper Reviews (0)
    • Projects (0)
    • 일상 (0)

Tag

알고리즘, C, 순열, 자료구조, 레벨2, BFS, 재귀, 재귀함수, 레벨1, dfs, 문자열, 2레벨, C++, 프로그래머스, 구현, 완전탐색, swift, 정렬, Sort, sorted,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/07   »
일 월 화 수 목 금 토
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

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바