Skip to content

Commit 6b39d2c

Browse files
committed
Revert "Updated the code with the question"
This reverts commit 0a913af.
1 parent 0a913af commit 6b39d2c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Hackerrank/birthday.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
/* You are in charge of the cake for a child's birthday. You have decided the cake will have one candle
2-
for each year of their total age. They will only be able to blow out the tallest of the candles.
3-
Count how many candles are tallest. A Program to input candle heights and print the total number
4-
of tallest candles present on the cake*/
51
import java.io.*;
62
import java.util.Arrays;
73
class birthday
84
{
95
int candle_count(int [] a, int x) //a method to sort and calculate the number of candles.
106
{
11-
Arrays.sort(a); //to sort the elements in ascending order
7+
Arrays.sort(a); //to sort the elements in asscending order
128
int c=0;
139
int lst= a[x-1];
1410
for(int i=x-1;i>=0;i--)
@@ -28,7 +24,7 @@ public static void main() throws IOException
2824
for(int i=0;i<ln;i++)
2925
{
3026
cdl[i]=Integer.parseInt(br.readLine());
31-
if(cdl[i]==0) //this will ensure that the input is not 0
27+
if(cdl[i]==0)
3228
i=i-1;
3329
}
3430
birthday obj= new birthday();

0 commit comments

Comments
 (0)