This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bitimiz(num): | |
num_bin = bin(num)[2:] | |
odds_bin = "" | |
evens_bin = "" | |
for i in range(len(num_bin)): | |
if (i%2 == 0): | |
odds_bin += num_bin[i] | |
evens_bin += "0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num = int(input("")) | |
while(num != 0): | |
num_bin = "00" + bin(num)[2:] | |
odds_bin = "" | |
evens_bin = "" | |
for i in range(len(num_bin)): | |
if (i%2 == 0): | |
odds_bin += num_bin[i] | |
evens_bin += "0" | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num = int(input("")) | |
while(num != 0): | |
num_bin = "00" + bin(num)[2:] | |
odds_bin = "" | |
evens_bin = "" | |
for i in range(len(num_bin)): | |
if (i%2 == 0): | |
odds_bin += num_bin[i] | |
evens_bin += "0" | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num = int(input("")) | |
while(num != 0): | |
num_bin = bin(num)[2:] | |
odds_bin = "" | |
evens_bin = "" | |
j = 0 | |
for i in range(0, len(num_bin)): | |
if (int(num_bin[i])%2== 0): | |
odds_bin += "0" | |
evens_bin += "0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hackerank; | |
import java.io.*; | |
import java.util.*; | |
public class Solution { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package project1; | |
public class Customer { | |
private int CustomerID; | |
private String Name; | |
private String Surname; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package project1; | |
public class InternationalCustomer extends Customer { | |
private String Country; | |
private String City; | |
public InternationalCustomer(){ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package project1; | |
public class NationalCustomer extends Customer{ | |
private int LicensePlateNumber; | |
private String Occupation; | |
public NationalCustomer() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InternationCustomer ic =new InternationCustomer(Integer.parseInt(st1.nextToken()), st1.nextToken(), st1.nextToken()); | |
customer1[customerSay] = ic; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public void addToCart(Item i){ | |
if (SoppingCart == null) | |
ShoppingCart = new ArrayList<Item>(); | |
ShoppingCart.add(i) | |
} |