Git Product home page Git Product logo

java-lotto's Introduction

๐Ÿš€ ๋กœ๋˜ 1๋‹จ๊ณ„ - ์ž๋™

๊ธฐ๋Šฅ ์š”๊ตฌ์‚ฌํ•ญ

  • ๋กœ๋˜ ๊ตฌ์ž… ๊ธˆ์•ก์„ ์ž…๋ ฅํ•˜๋ฉด ๊ตฌ์ž… ๊ธˆ์•ก์— ํ•ด๋‹นํ•˜๋Š” ๋กœ๋˜๋ฅผ ๋ฐœ๊ธ‰ํ•ด์•ผ ํ•œ๋‹ค.
  • ๋กœ๋˜ 1์žฅ์˜ ๊ฐ€๊ฒฉ์€ 1000์›์ด๋‹ค.
๊ตฌ์ž…๊ธˆ์•ก์„ ์ž…๋ ฅํ•ด ์ฃผ์„ธ์š”.
14000
14๊ฐœ๋ฅผ ๊ตฌ๋งคํ–ˆ์Šต๋‹ˆ๋‹ค.
[8, 21, 23, 41, 42, 43]
[3, 5, 11, 16, 32, 38]
[7, 11, 16, 35, 36, 44]
[1, 8, 11, 31, 41, 42]
[13, 14, 16, 38, 42, 45]
[7, 11, 30, 40, 42, 43]
[2, 13, 22, 32, 38, 45]
[23, 25, 33, 36, 39, 41]
[1, 3, 5, 14, 22, 45]
[5, 9, 38, 41, 43, 44]
[2, 8, 9, 18, 19, 21]
[13, 14, 18, 21, 23, 35]
[17, 21, 29, 37, 42, 45]
[3, 8, 27, 30, 35, 44]

์ง€๋‚œ ์ฃผ ๋‹น์ฒจ ๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•ด ์ฃผ์„ธ์š”.
1, 2, 3, 4, 5, 6
๋ณด๋„ˆ์Šค ๋ณผ์„ ์ž…๋ ฅํ•ด ์ฃผ์„ธ์š”.
7

๋‹น์ฒจ ํ†ต๊ณ„
---------
3๊ฐœ ์ผ์น˜ (5000์›)- 1๊ฐœ
4๊ฐœ ์ผ์น˜ (50000์›)- 0๊ฐœ
5๊ฐœ ์ผ์น˜ (1500000์›)- 0๊ฐœ
5๊ฐœ ์ผ์น˜, ๋ณด๋„ˆ์Šค ๋ณผ ์ผ์น˜(30000000์›) - 0๊ฐœ
6๊ฐœ ์ผ์น˜ (2000000000์›)- 0๊ฐœ
์ด ์ˆ˜์ต๋ฅ ์€ 0.35์ž…๋‹ˆ๋‹ค.(๊ธฐ์ค€์ด 1์ด๊ธฐ ๋•Œ๋ฌธ์— ๊ฒฐ๊ณผ์ ์œผ๋กœ ์†ํ•ด๋ผ๋Š” ์˜๋ฏธ์ž„)

ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์š”๊ตฌ์‚ฌํ•ญ

  • indent(์ธ๋ดํŠธ, ๋“ค์—ฌ์“ฐ๊ธฐ) depth๋ฅผ 2๋‹จ๊ณ„์—์„œ 1๋‹จ๊ณ„๋กœ ์ค„์—ฌ๋ผ.
    • depth์˜ ๊ฒฝ์šฐ if๋ฌธ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ 1๋‹จ๊ณ„์˜ depth๊ฐ€ ์ฆ๊ฐ€ํ•œ๋‹ค. if๋ฌธ ์•ˆ์— while๋ฌธ์„ ์‚ฌ์šฉํ•œ๋‹ค๋ฉด depth๊ฐ€ 2๋‹จ๊ณ„๊ฐ€ ๋œ๋‹ค.
  • else๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ๋งˆ๋ผ.
  • ๋ฉ”์†Œ๋“œ์˜ ํฌ๊ธฐ๊ฐ€ ์ตœ๋Œ€ 10๋ผ์ธ์„ ๋„˜์ง€ ์•Š๋„๋ก ๊ตฌํ˜„ํ•œ๋‹ค.
    • method๊ฐ€ ํ•œ ๊ฐ€์ง€ ์ผ๋งŒ ํ•˜๋„๋ก ์ตœ๋Œ€ํ•œ ์ž‘๊ฒŒ ๋งŒ๋“ค์–ด๋ผ.
  • ๋ฐฐ์—ด ๋Œ€์‹  ArrayList๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.
  • java enum์„ ์ ์šฉํ•ด ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ๊ตฌํ˜„ํ•œ๋‹ค.
  • ๊ทœ์น™ 3: ๋ชจ๋“  ์›์‹œ๊ฐ’๊ณผ ๋ฌธ์ž์—ด์„ ํฌ์žฅํ•œ๋‹ค.
  • ๊ทœ์น™ 5: ์ค„์—ฌ์“ฐ์ง€ ์•Š๋Š”๋‹ค(์ถ•์•ฝ ๊ธˆ์ง€).
  • ๊ทœ์น™ 8: ์ผ๊ธ‰ ์ฝœ๋ ‰์…˜์„ ์“ด๋‹ค.

ํžŒํŠธ

  • ๋กœ๋˜ ์ž๋™ ์ƒ์„ฑ์€ Collections.shuffle() ๋ฉ”์†Œ๋“œ ํ™œ์šฉํ•œ๋‹ค.
  • Collections.sort() ๋ฉ”์†Œ๋“œ๋ฅผ ํ™œ์šฉํ•ด ์ •๋ ฌ ๊ฐ€๋Šฅํ•˜๋‹ค.
  • ArrayList์˜ contains() ๋ฉ”์†Œ๋“œ๋ฅผ ํ™œ์šฉํ•˜๋ฉด ์–ด๋–ค ๊ฐ’์ด ์กด์žฌํ•˜๋Š”์ง€ ์œ ๋ฌด๋ฅผ ํŒ๋‹จํ•  ์ˆ˜ ์žˆ๋‹ค.

java-lotto's People

Contributors

kouz95 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.