codingame problem solving (1)
codingame problem solving (1)
selector: 'display-component',
template: `
<div id="lastVote">{{ answer }}</div>
<voter-component
[question]="question"
[yesAnswer]="yesAnswer"
[noAnswer]="noAnswer"
(output)="setVote($event)"
></voter-component>
`
})
export class DisplayComponent {
public question = 'Too easy?';
public yesAnswer = 'Yes';
public noAnswer = 'no';
public answer: boolean;
setVote(event: boolean) {
this.answer = event ? this.yesAnswer : this.noAnswer;
}
}
-----------------------------------------------------------------
selector:'transaction-component',
template: `
<div id="fee">
{{fee | percent : '2.2-3'}}
</div>
<div id="amount">
{{amount | currency : currency :'symbol' : '9.2-2'}}
</div>
<div id="time">
{{timeOfTransaction | date : 'ww: yyyy MMMMM dd hh-mm-ss'}}
</div>
`
* Implémentez la méthode boolean A.exists(int[] ints, int k) afin qu’elle retourne true si k est
présent dans ints, sinon la méthode devra retourner false.
----------------------------------------------------------------------
public class Concatenation {
}
------------------------------------------------------------------------
class Solution {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
if(n == 0){
System.out.println("0");
return;
}
in.nextLine();
String[] tempL = in.nextLine().split(" ");
int min = Integer.parseInt(tempL[0]);
for (String strTemp : tempL) {
int temp = Integer.parseInt(strTemp);
if(Math.abs(temp) < Math.abs(min) || (0 < temp && -min == temp)){
min = temp;
}
}
System.out.println(min);
}
}
-------------------------------------------------------------------------------
class ClosestToZero {
-------------------------------------------------------------------------------------
}
}
--------------------------------------------------------------------
isTwin(a , b) ?
--------------------------------------------------------------------------------
class StreamPrinter {
--------------------------------ORR-******
try {
int code = reader.read();
while (code != -1) {
System.out.print((char) code);
code = reader.read();
}
} finally {
try {
reader.close();
} catch(IOException e) {
// Log here.
}
}
-----------------------------------------------------------
A.a( int I , int j)
Class A {
static boolean a ( int I , int j) {
if(i ==1 | | j ==1 ))
return true;
else
return false;
}
Node : implement a new Node’s methode named find(int v) which return the node holding the
value of v if the node doesn’t exist then find should return null .
Class Node {
Node left , right;
int value ;
Node current = null;
public Node find(int v) {
}
return current;
}
}
SQL
Vehicle_part **
-------------------------------------------------
Select vehicle_part.vehicle_part_id , RFID
on vehicle_part.vehicle_part_id = vehicle_part_location.vehicle_part_id
------------------------------------------------------
Modifier la requete pour selectionner uniquement les clients ayant passe au moins deux
commandes .
Select lastname as customer_lastname , Count(purchase_order.customer_id ) as purchase_count
on customer.customer_id = purchase_order.customer_id
group by purchase_order.customer_id
order by lastname
-------------------------------------------------------
n’est pas afficher de valeur null pour la catégorie.
select Product.name as PRODUCT_NAME , Product_category.name as CATEGORY_NAME
ON Product.product_category_id = Product_category.product_category_id
----------------------------------------------------------------------
Problem : Select only the customer IDs (Not duplicates and sorted in ascending) who
purchased at least one product in "Books" or "Garden" category.