강의

멘토링

로드맵

Inflearn Community Q&A

yejilee224254's profile image
yejilee224254

asked

Introduction to Java Algorithm Problem Solving: Coding Test Preparation

1. Print the largest number

solution 클래스 관련 질문드립니다.

Resolved

Written on

·

202

0

강사님 안녕하세요!

solution 클래스 작성 시 int n과 int[] arr 두 가지를 인자로 받을 때와 int[] arr 한 가지만 인자로 받을 때 결과는 같은데 차이점이 궁금해서 질문드립니다.

public ArrayList<Integer> solution (int n, int[] arr)

public ArrayList<Integer> solution (int[] arr)

java코테 준비 같이 해요!

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

출제자의 취향일 뿐입니다. 굳이 n을 알려주기 않고 스스로 arr의 길이를 구해서 하라고 할 수 도 있겠죠.

yejilee22님의 프로필 이미지
yejilee22
Questioner

앗 이해됐습니다!! 답변 감사합니다!!

yejilee224254's profile image
yejilee224254

asked

Ask a question