Sort by

recency

|

467 Discussions

|

  • + 0 comments

    Rummy is a game of strategy, where players must plan and execute their moves carefully to outsmart their opponents. Players need to think ahead, decide which cards to keep and which to discard, and form sets and sequences while also predicting the moves of others. This process of strategic planning strengthens decision-making abilities click here to get the latest version of the app, as players are constantly assessing the potential outcomes of their actions. Such strategic thinking can be transferred to real-life situations, helping players make more informed and thoughtful decisions in daily activities.

  • + 0 comments
    import java.util.*;
    
    interface commonDevison {
        int divisor(int n);
        
        
    }
    
    class calculator implements commonDevison{
        public int divisor(int n){
            int sum = 0;
            
            for(int i=1;i<=n;i++){
                if(n%i==0){
                    sum+=i;
                }
            }
            return sum;
        }
    }
    
    public class Solution {
    
        public static void main(String[] args) {
            /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
           Scanner input = new Scanner(System.in);
           int n = input.nextInt();
           
           commonDevison calculator = new calculator(); 
           System.out.println("I implemented: AdvancedArithmetic");
           System.out.println(calculator.divisor(n));
        }
    }
    
  • + 0 comments

    **JAVA SOLUTION |||| USE JAVA 8 OR 7 **

    final class MyCalculator implements AdvancedArithmetic{
        int divisor;
        @Override
        
        public int divisor_sum(int n) {
            
            for (int i = 1; i <= n; i++) {
                if(n%i == 0){
                    divisor += i;
                }
            }        
            return divisor;
            
        }
    }
    //Write your code here
    
  • + 0 comments
    //Write your code here
    class  MyCalculator implements AdvancedArithmetic{
        public int divisor_sum(int n){
            int sum = 0 ;      
            for (int i = 1 ; i <= n ; i++ ){
            if(n % i == 0){
                sum += i;
            }
          }
          return sum;
        }
    }
    
  • + 0 comments

    public int divisor_sum(int n){ List ls = new ArrayList<>(); for(int i=1;i<1001;i++){ if(n % i == 0){ ls.add(i); } } int sum=0; for(int j : ls) { sum+=j; } return sum; }