sudeep91soni
BAN USERThis code prints subset of answer... but not all answers
package codeforce;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Setsofk {
public static void main(String [] args)
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
List<Integer> li = new ArrayList<>();
Map<Integer, List<Integer>> m = new HashMap<>();
List<Integer> set=new ArrayList<>();
try {
int k=Integer.parseInt(br.readLine());
String[] array=br.readLine().split(",");
for(int i=0; i<array.length; i++)
{
li.add(Integer.parseInt(array[i]));
}
System.out.println(li);
Collections.sort(li);
System.out.println(li);
int key=0;
for(int i=0; i<li.size(); i++)
{
int sum=li.get(i);
set.clear();
set.add(li.get(i));
for(int j=i+1; j<li.size(); j++)
{
sum=li.get(i);
int l=j;
while(l<li.size())
{
sum+=li.get(l);
if(sum<k)
{
set.add(li.get(l));
}
else if(sum==k)
{
set.add(li.get(l));
if(m.containsValue(set))
{
continue;
}
else
{
m.put(key, new ArrayList<Integer>(set));
key++;
break;
}
}
else if(sum>k)
{
break;
}
l++;
}
set.clear();
set.add(li.get(i));
}
}
System.out.println(m);
} catch (NumberFormatException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
package test;
import java.io.DataInputStream;
import java.io.IOException;
public class MultipleOf3 {
public static void main(String [] args)
{
int in;
DataInputStream br=new DataInputStream(System.in);
try {
int sum=0;
while((in=br.read())!='a')
{
Character c=(char)in;
int i = 0;
if(c<='9'&&c>='0')
{
i=Integer.parseInt(c.toString());
sum+=i;
System.out.print(i);
if(sum%3==0)
{
break;
}
}
}
System.out.println();
System.out.println("div by 3!!!");
} catch (IOException e) {
e.printStackTrace();
}
}
}
They Should be able to interact with the users using voice communication. OS should be able to customize itself according to User needs.
- sudeep91soni January 13, 2015import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
public class Phone {
public static void main(String [] args)
{
String str = null;
String quest=null;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Map<String, List<Integer>> hmap = new HashMap<String, List<Integer>>();
try {
while((str=br.readLine()) != null)
{
String [] tokens;
tokens=str.split("---");
if(tokens.length==1)
{
quest=tokens[0];
System.out.println(quest);
break;
}
else
{
if(hmap.containsKey(tokens[0].toLowerCase()))
{
List<Integer> hl=hmap.get(tokens[0].toLowerCase());
hl.add(Integer.parseInt(tokens[1]));
}
else
{
List<Integer> hl = new ArrayList<>();
hl.add(Integer.parseInt(tokens[1]));
hmap.put(tokens[0].toLowerCase(),hl);
}
}
System.out.println(hmap);
}
} catch (NumberFormatException | IOException e1) {
e1.printStackTrace();
}
for(Entry<String, List<Integer>> e:hmap.entrySet())
{
if(e.getKey().equals(quest.toString()))
{
System.out.println(e.getValue().toString());
}
}
}
}
package test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
public class Hashtest {
public static void main(String [] args)
{
String str = null;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
str=br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
String [] tokens;
tokens=str.split(" ");
Map<String, Integer> hmap = new HashMap<String, Integer>();
for (String string : tokens) {
if(hmap.containsKey(string))
{
int i=hmap.get(string).intValue();
hmap.put(string, i+1);
}
else
{
hmap.put(string, 1);
}
}
for(Entry<String, Integer> e:hmap.entrySet())
{
if(e.getValue().equals(1))
{
System.out.println(e.getKey());
}
}
}
}
RepHi, my name is Ethel Olson, and I'm a record clerk for the city of Hamburg. I am searching ...
RepUrfiDolomi, Android Engineer at Abs india pvt. ltd.
I am working as a library aide with 3 years experience in this field. I understand how to file and ...
RepShaneFrazier, Analyst at Brocade
I am Shane , a professional with 7 years of experience in financial markets. Outperforms, manages client satisfaction for Vashikaran Specialist ...
RepWilliamWiltz, Call Girls in Chawri Bazar at Amdocs
Hi , I am William, a Medical technologist with extensive knowledge around sample examination and analyzing results. Selected from a pool ...
RepEileenBrown, Android Engineer at ABC TECH SUPPORT
Eileen Brown and I am a Product designer.And nowadays I am doing new research like istikhara for love marriage ...
Repdebrak836636, Developer Program Engineer at Arista Networks
I am Debra , a multilingual (English/Italian/French) Judge with 5 years of experience in presiding over court proceedings, prosecuting ...
Repjosebowlin78, Aircraft engineer at CSK Auto
I am an Aircraft engineer . My role as an aircraft engineer involves the application of scientific and technological principles to ...
Repchomeshgeles, Android Engineer at ABC TECH SUPPORT
ReevesMildr , a builder working at Independent Investors . It has been almost 5 years since I have been working here. I ...
this is the perfect solution in c++. My previous solution was not giving all outputs...
- sudeep91soni January 15, 2015