Compare commits
5 Commits
b84425cb17
...
ff20bf65fd
Author | SHA1 | Date |
---|---|---|
|
ff20bf65fd | 1 month ago |
|
bcd16c6c64 | 1 month ago |
|
3743016a3c | 1 month ago |
|
81f70fccfe | 1 month ago |
|
1890db68dd | 1 month ago |
@ -1,3 +1,4 @@
|
|||||||
java temurin-21.0.3+9.0.LTS
|
java temurin-21.0.3+9.0.LTS
|
||||||
maven 3.9.6
|
maven 3.9.6
|
||||||
|
pyton 3.13.3
|
||||||
ghc 9.8.4
|
ghc 9.8.4
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
SELECT *
|
||||||
|
FROM CITY
|
||||||
|
WHERE COUNTRYCODE = 'USA'
|
||||||
|
AND POPULATION > 100000;
|
||||||
|
|
||||||
|
|
||||||
|
SELECT CITY, STATE
|
||||||
|
FROM STATION;
|
||||||
|
|
||||||
|
|
||||||
|
SELECT DISTINCT CITY FROM STATION WHERE ID % 2 = 0;
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.olexyn.field.kit.hacker.rank.problems;
|
||||||
|
|
||||||
|
public class CatMouseABC {
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static String catAndMouse(int x, int y, int z) {
|
||||||
|
|
||||||
|
int dx = Math.abs(x - z);
|
||||||
|
int dy = Math.abs(y - z);
|
||||||
|
if (dx == dy) {
|
||||||
|
return "Mouse C";
|
||||||
|
}
|
||||||
|
if (dx < dy) {
|
||||||
|
return "Cat A";
|
||||||
|
}
|
||||||
|
return "Cat B";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.olexyn.field.kit.hacker.rank.problems;
|
||||||
|
|
||||||
|
public class KeysBudget {
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static int getMoneySpent(int[] keyboards, int[] drives, int b) {
|
||||||
|
int max = -1;
|
||||||
|
|
||||||
|
for (int k : keyboards) {
|
||||||
|
for (int d : drives) {
|
||||||
|
int sum = k + d;
|
||||||
|
if (sum <= b && sum > max) {
|
||||||
|
max = sum;
|
||||||
|
}
|
||||||
|
if (max == b) {
|
||||||
|
return max;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return max;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,13 +0,0 @@
|
|||||||
package org.example;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hello world!
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class App
|
|
||||||
{
|
|
||||||
public static void main( String[] args )
|
|
||||||
{
|
|
||||||
System.out.println( "Hello World!" );
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,32 @@
|
|||||||
|
def do_foo():
|
||||||
|
if n % 2 == 1:
|
||||||
|
print('Weird')
|
||||||
|
return
|
||||||
|
if 1 < n < 6:
|
||||||
|
print('Not Weird')
|
||||||
|
if 5 < n < 12:
|
||||||
|
print('Weird')
|
||||||
|
if 19 < n:
|
||||||
|
print('Not Weird')
|
||||||
|
|
||||||
|
|
||||||
|
def log_base_10(n):
|
||||||
|
if n == 0:
|
||||||
|
return float('-inf') # Logarithm of 0 is undefined
|
||||||
|
count = 0
|
||||||
|
while n >= 1:
|
||||||
|
n /= 10
|
||||||
|
count += 1
|
||||||
|
return count
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
n = 102
|
||||||
|
out = 0
|
||||||
|
for i in range(1, n + 1):
|
||||||
|
power = (i // 10 + 1)
|
||||||
|
|
||||||
|
# print(i, i / 10, log_base_10(i), pow(10, log_base_10(i) - 1), pow(10, power))
|
||||||
|
out = out * pow(10, log_base_10(i)) + i
|
||||||
|
|
||||||
|
print(out)
|
@ -0,0 +1,11 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.olexyn</groupId>
|
||||||
|
<artifactId>field-kit</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</parent>
|
||||||
|
<artifactId>py-kit</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<!-- dummy -->
|
||||||
|
</project>
|
@ -0,0 +1,20 @@
|
|||||||
|
def log_base_10(n):
|
||||||
|
if n == 0:
|
||||||
|
return float('-inf') # Logarithm of 0 is undefined
|
||||||
|
count = 0
|
||||||
|
while n >= 1:
|
||||||
|
n /= 10
|
||||||
|
count += 1
|
||||||
|
return count
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
n = 102
|
||||||
|
out = 0
|
||||||
|
for i in range(1, n + 1):
|
||||||
|
power = (i // 10 + 1)
|
||||||
|
|
||||||
|
# print(i, i / 10, log_base_10(i), pow(10, log_base_10(i) - 1), pow(10, power))
|
||||||
|
out = out * pow(10, log_base_10(i)) + i
|
||||||
|
|
||||||
|
print(out)
|
Loading…
Reference in new issue