You are viewing a single comment's thread. Return to all comments →
import java.io.; import java.util.; import java.math.BigDecimal;
public class Solution {
public static void main(String[] args) { Scanner scan=new Scanner(System.in); List nums= new ArrayList<>(); for(int i=0, n=scan.nextInt();i
nums.sort((num1, num2)->{ BigDecimal bnum1=new BigDecimal(num1); BigDecimal bnum2=new BigDecimal(num2); return -bnum1.compareTo(bnum2); }); for(String num: nums) System.out.println(num);
} }
****
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Java BigDecimal
You are viewing a single comment's thread. Return to all comments →
import java.io.; import java.util.; import java.math.BigDecimal;
public class Solution {
public static void main(String[] args) { Scanner scan=new Scanner(System.in); List nums= new ArrayList<>(); for(int i=0, n=scan.nextInt();i
} }
****