Coding | EXAMS | IBM ACCENTURE | VIRTUSA | IBM | AMAZON | TCS | EPAM | WILEY EDGE | TECH MAHINDRA | JPMORGAN | HCL | WIPRO
3.36K subscribers
1.13K photos
3 videos
17 files
373 links
Main channel https://t.me/Coding_000
Contact Admin 👉 @ILOVEU_143 for booking your exam slots
Web- https://coding000.github.io/Projects/
💯% clearance in any placement exams
OffCampus -https://t.me/Offcampus_000
Discussion- https://t.me/exams_discussion
Download Telegram
int result=0;
  Arrays.sort(input3);
 
  int i=0;
  int k=input3.length-1;
  while(input2>0) {
   result=result+input3[k];
   i++;
   k--;
   input2--;
  }
 
  return result;



Coding marathon
Java8
share @Coding_000❤️
👍5
def construct_graph(n):
    graph = [[] for _ in range(n+1)]
    for i in range(2, n+1):
        for j in range(2*i, n+1, i):
            graph[i].append(j)
            graph[j].append(i)
    return graph

def dfs(node, graph, visited):
    visited.add(node)
    for neighbor in graph[node]:
        if neighbor not in visited:
            dfs(neighbor, graph, visited)

def count_groups(n):
    graph = construct_graph(n)
    visited = set()
    groups = 0
    for i in range(2, n+1):
        if i not in visited:
            groups += 1
            dfs(i, graph, visited)
    return groups

Social Network- Python Code
👍5
Give reactions guys..and share our channel...to get more solutions...❤️😁
👍7👏1
import java.text.*;
import java.util.*;

public class MonthDirefence {
  public static int getMonthDiffence(String d1, String d2) throws ParseException {
    SimpleDateFormat sdf = new SimpleDateFormat("dd-mm-yyyy");
    Date start = sdf.parse(d1);
    Date end = sdf.parse(d2);
    Calendar startC = new GregorianCalendar();
    startC.setTime(start);
    Calendar endC = new GregorianCalendar();
    endC.setTime(end);

    int diffYear = endC.get(Calendar.YEAR) - startC.get(Calendar.YEAR);
 
    return diffYear;
  }

  public static void main(String[] args) throws ParseException {
    Scanner sc = new Scanner(System.in);
    String d1 = sc.nextLine();
    String d2 = sc.nextLine();
    System.out.println(getMonthDiffence(d1, d2));

  }

}
Documents code
@Coding_000
👍4
int countNecklaces(int maxPearls, int startMagnificence, int endMagnificence) {
    int count = 0;
    for (int pearls = 1; pearls <= maxPearls; pearls++) {
        for (int magnificence = startMagnificence; magnificence <= endMagnificence; magnificence++) {
            if (pearls == 1) {
                count++; // count necklaces with one pearl
            } else {
                int prevCount = count; // remember count before adding necklaces with pearls-1
                for (int prevMagnificence = startMagnificence; prevMagnificence <= magnificence; prevMagnificence++) {
                    count += prevCount; // add count for each magnificence power
                }
            }
        }
    }
    return count;
} charles and necklace
C++👨‍💻
👍3🤔2
Pls give feedback about our work


Join: @Coding_000
contact -@ILOVEU_143❤️

Share my channel with your friends and college groups🥳

Trust us Expect us 👍👍😍
5🔥2👨‍💻1