HelloMinchan
처음처럼
HelloMinchan
LinkedIn
전체 방문자
오늘
어제
  • 분류 전체보기 (306)
    • Backend (4)
      • NestJS (1)
      • Express (1)
      • Spring (2)
    • Infrastructure (1)
      • AWS (1)
    • Frontend (1)
      • Next.js (1)
    • Language & Runtime (4)
      • Java (2)
      • Node.js (2)
    • Computer Science (8)
      • Computer Networks (3)
      • Operating Systems (4)
      • OOP (1)
    • 독서 (4)
      • 데이터 중심 애플리케이션 설계 (3)
      • 객체지향의 사실과 오해 (1)
    • 회고 (4)
      • Project (2)
      • Career (2)
    • Deprecated (280)

채널

  • GitHub
  • LinkedIn

최근 글

태그

  • 백엔드
  • 백준Go
  • 프로그래머스Python
  • front-end
  • 코딩
  • 프로그래밍
  • Algospot
  • back-end
  • Database
  • programmers
  • 알고스팟Python
  • 알고스팟
  • 개발자
  • 백준Python
  • 백준
  • 프로그래머스
  • 데이터베이스
  • 프로그래머스C++
  • 백준C++
  • Baekjoon Online Judge

최근 댓글

인기 글

hELLO
HelloMinchan

처음처럼

[LeetCode] 리트코드 1295번 Find Numbers with Even Number of Digits(Python)
Deprecated

[LeetCode] 리트코드 1295번 Find Numbers with Even Number of Digits(Python)

2020. 3. 11. 09:24

Copyright © 2020 LeetCode

[LeetCode] 리트코드 1295번 Find Numbers with Even Number of Digits

(Python)

(글쓴날 : 2020.03.11)

 


* LeetCode, 리트코드 1295번 문제 Python 언어 풀이입니다.

* 소스 코드의 저작권은 글쓴이에게 있습니다.


 

 

리트코드 1295번 Find Numbers with Even Number of Digits


1) 문제

문제 링크 : https://leetcode.com/problems/find-numbers-with-even-number-of-digits/

 

Find Numbers with Even Number of Digits - LeetCode

Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

leetcode.com


2) 풀이 과정

배열(Python의 경우 리스트)에 속한 숫자들의 자릿수가 짝수인 개수를 구하는 문제입니다.

저의 경우, 각 숫자들을 문자열로 형변환한 후 길이를 구하여 짝수인 것 들의 개수를 구하였습니다.


3) 코드

 

* Python 코드

1
2
3
4
5
6
7
8
9
class Solution:
 
    def findNumbers(self, nums: List[int]) -> int:
        count = 0
        for i in nums:
            if len(str(i)) % 2 == 0:
                count += 1
                
        return count 

 

저작자표시 비영리 변경금지 (새창열림)

'Deprecated' 카테고리의 다른 글

[CSS] CSS 초기화(Reset) 코드 모음  (0) 2020.03.12
[LeetCode] 리트코드 1266번 Minimum Time Visiting All Points(Python)  (0) 2020.03.11
[LeetCode] 리트코드 1108번 Defanging an IP Address(Python)  (0) 2020.03.11
[Baekjoon Online Judge] 백준 5543번 상근날드(Python)  (0) 2020.03.10
[styled-components] styled-components 소개 및 설치 방법  (0) 2020.03.10
    'Deprecated' 카테고리의 다른 글
    • [CSS] CSS 초기화(Reset) 코드 모음
    • [LeetCode] 리트코드 1266번 Minimum Time Visiting All Points(Python)
    • [LeetCode] 리트코드 1108번 Defanging an IP Address(Python)
    • [Baekjoon Online Judge] 백준 5543번 상근날드(Python)
    HelloMinchan
    HelloMinchan
    Though you should not fear failure, You should do your very best to avoid it.

    티스토리툴바