Dashboard Temp Share Shortlinks Frames API

djdj - HTMLify profile

files of /djdj/challange/

Day 76 /djdj/challange/Day76.php
10 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @return Integer
*/
function thirdMax($nums) {
$n
Day 1 HackerRank SQl /djdj/challange/day1.sql
104 Views
0 Comments
/*
https://www.hackerrank.com/challenges/
revising-the-select-query/problem
*/

SELECT *
FROM CITY
WHERE population > 100000
Day 10 /djdj/challange/day10.sql
117 Views
0 Comments
/*
https://www.hackerrank.com/challenges/weather-observation-station-5/problem
*/

SELECT CITY, LENGTH(CITY)
FROM STATION
ORDER
Day 11 /djdj/challange/day11.sql
69 Views
0 Comments
/*
https://www.hackerrank.com/challenges/weather-observation-station-6/problem
*/

SELECT DISTINCT CITY
FROM STATION
WHERE CITY
Day 12 /djdj/challange/day12.sql
73 Views
0 Comments
/*
https://www.hackerrank.com/challenges/weather-observation-station-7/problem
*/

SELECT DISTINCT CITY
FROM STATION
WHERE CITY
Day 13 /djdj/challange/day13.sql
101 Views
0 Comments
/*
https://www.hackerrank.com/challenges/weather-observation-station-8/problem
*/

SELECT DISTINCT CITY
FROM STATION
WHERE CITY
Day 14 /djdj/challange/day14.sql
98 Views
0 Comments
/*
https://www.hackerrank.com/challenges/weather-observation-station-9/problem
*/

SELECT DISTINCT CITY
FROM STATION
WHERE CITY
Day 15 /djdj/challange/day15.sql
70 Views
0 Comments
/*
https://www.hackerrank.com/challenges/weather-observation-station-10/problem
*/

SELECT DISTINCT CITY
FROM STATION
WHERE CIT
Day 16 /djdj/challange/day16.sql
77 Views
0 Comments
/*
https://www.hackerrank.com/challenges/weather-observation-station-11/problem
*/

SELECT DISTINCT CITY
FROM STATION
WHERE LEF
Day 17 /djdj/challange/day17.sql
88 Views
0 Comments
/*
https://www.hackerrank.com/challenges/weather-observation-station-12/problem
*/

SELECT DISTINCT CITY
FROM STATION
WHERE LEF
Day 18 /djdj/challange/day18.sql
60 Views
0 Comments
/*
https://leetcode.com/problems/combine-two-tables/description
*/

# Write your MySQL query statement below
Select firstName,
Day 19 /djdj/challange/day19.sql
63 Views
0 Comments
/*
https://leetcode.com/problems/second-highest-salary/
*/

# Write your MySQL query statement below
select
(select distinct
Day 2 /djdj/challange/day2.sql
101 Views
0 Comments
SELECT name
FROM city
WHERE countrycode = 'USA'
AND population > 120000;
Day 20 /djdj/challange/day20.sql
61 Views
0 Comments
/*
https://leetcode.com/problems/employees-earning-more-than-their-managers/description/
*/

# Write your MySQL query statement
Day 21 /djdj/challange/day21.sql
50 Views
0 Comments
# Write your MySQL query statement below
select email from person
group by email
having count(email) > 1;
Day 22 /djdj/challange/day22.sql
75 Views
0 Comments
# Write your MySQL query statement below
select name as Customers from Customers
where id not in(select customerId from Orders);
Day 23 /djdj/challange/day23.sql
79 Views
0 Comments
# Write your MySQL query statement below
delete p1
from Person p1
inner join Person p2
on p1.email = p2.email
where p1.id > p2.i
Day 24 /djdj/challange/day24.sql
48 Views
0 Comments
# Write your MySQL query statement below
SELECT w1.id
FROM Weather w1
JOIN Weather w2
ON DATEDIFF(w1.recordDate, w2.recordDate
Day 25 /djdj/challange/day25.sql
55 Views
0 Comments
# Write your MySQL query statement below
SELECT
player_id,
MIN(event_date) AS first_login
FROM
Activity
GROUP BY
Day 26 /djdj/challange/day26.sql
74 Views
0 Comments
# Write your MySQL query statement below
SELECT name
FROM Employee
WHERE id IN (
SELECT managerId
FROM Employee
WHER
Day 27 /djdj/challange/day27.sql
59 Views
0 Comments
# Write your MySQL query statement below
select name,bonus from employee
left join bonus
on bonus.empId = employee.empId
where b
Day 28 /djdj/challange/day28.sql
56 Views
0 Comments
# Write your MySQL query statement below
select round(sum(tiv_2016),2) as tiv_2016
from Insurance
WHERE
tiv_2015 IN (

Day 29 /djdj/challange/day29.sql
76 Views
0 Comments
# Write your MySQL query statement below
SELECT customer_number FROM Orders
GROUP BY customer_number
ORDER BY COUNT(*) desc limi
Day 3 /djdj/challange/day3.sql
110 Views
0 Comments
SELECT *
FROM city;
Day 30 /djdj/challange/day30.sql
57 Views
0 Comments
# Write your MySQL query statement below
select name,population,area from World
where area >= 3000000 or population >= 25000000;
Day 31 /djdj/challange/day31.sql
70 Views
0 Comments
# Write your MySQL query statement below
select class from courses
group by class
having count(class) >= 5
Day 32 /djdj/challange/day32.sql
72 Views
0 Comments
# Write your MySQL query statement below
SELECT MAX(num) AS num
FROM (
SELECT num
FROM MyNumbers
GROUP BY num
HA
Day 33 /djdj/challange/day33.sql
47 Views
0 Comments
# Write your MySQL query statement below
select * from cinema
where id % 2 = 1 and description != 'boring' order by rating desc;
Day 34 /djdj/challange/day34.sql
51 Views
0 Comments
# Write your MySQL query statement below
update salary set sex = replace('m',sex,'f');
Day 35 /djdj/challange/day35.sql
63 Views
0 Comments
# Write your MySQL query statement below
SELECT customer_id
FROM Customer
GROUP BY customer_id
HAVING COUNT(DISTINCT product_key
Day 36 /djdj/challange/day36.sql
63 Views
0 Comments
# Write your MySQL query statement below
select actor_id,director_id from ActorDirector
group by actor_id, director_id
Having c
Day 37 /djdj/challange/day37.sql
44 Views
0 Comments
# Write your MySQL query statement below
select product_name, year, price
from Sales
inner join Product
where Sales.product_i
Day 38 /djdj/challange/day38.sql
52 Views
0 Comments
# Write your MySQL query statement below
select distinct p.project_id, Round(AVG(e.experience_years), 2) AS average_years
from
Day 39 /djdj/challange/day39.sql
57 Views
0 Comments
# Write your MySQL query statement below
select distinct author_id as id
from Views
where author_id = viewer_id
order by id a
Day 4 /djdj/challange/day4.sql
108 Views
0 Comments
SELECT *
FROM city
WHERE id = '1661';
Day 40 /djdj/challange/day40.sql
51 Views
0 Comments
# Write your MySQL query statement below
select
p.product_id,
round(coalesce(sum(p.price * u.units) / sum(u.units),0), 2) a
Day 41 /djdj/challange/day41.sql
48 Views
0 Comments
# Write your MySQL query statement below
SELECT
s.student_id,
s.student_name,
sub.subject_name,
COUNT(e.subj
Day 42 /djdj/challange/day42.sql
36 Views
0 Comments
# Write your MySQL query statement below
SELECT
p.product_name,
SUM(o.unit) AS unit
FROM
Products AS p
LEFT JOIN

Day 43 /djdj/challange/day43.sql
28 Views
0 Comments
# Write your MySQL query statement below
select unique_id,name from Employees
left join EmployeeUNI
on Employees.id = EmployeeUN
Day 44 /djdj/challange/day44.sql
43 Views
0 Comments
# Write your MySQL query statement below
SELECT
sell_date,
COUNT(DISTINCT product) AS num_sold,
GROUP_CONCAT(DISTI
Day 45 /djdj/challange/day45.sql
32 Views
0 Comments
# Write your MySQL query statement below
-- select * from Users where mail REGEXP '^[a-zA-Z][a-zA-Z0-9._-]*@leetcode\\.com$';
SE
Day 46 /djdj/challange/day46.sql
23 Views
0 Comments
# Write your MySQL query statement below
SELECT * FROM patients
WHERE conditions LIKE '% DIAB1%' or conditions LIKE 'DIAB1%' ;
Day 47 /djdj/challange/day47.sql
25 Views
0 Comments
# Write your MySQL query statement below
SELECT v.customer_id,
COUNT(v.visit_id) AS count_no_trans
FROM Visits v
LEFT JO
Day 48 /djdj/challange/day48.sql
36 Views
0 Comments
# Write your MySQL query statement below
SELECT user_id, CONCAT(UPPER(LEFT(name,1)),LOWER(SUBSTRING(name,2))) AS name
FROM Users
Day 49 /djdj/challange/day49.sql
32 Views
0 Comments
# Write your MySQL query statement below
select tweet_id from Tweets where length(content) > 15;
Day 5 /djdj/challange/day5.sql
70 Views
0 Comments
SELECT *
FROM city
WHERE countrycode = 'JPN';
Day 50 /djdj/challange/day50.sql
37 Views
0 Comments
# Write your MySQL query statement below
select user_id, count(follower_id) as followers_count from Followers
group by user_id
o
Day 51 /djdj/challange/day51.sql
27 Views
0 Comments
# Write your MySQL query statement below
select product_id from Products
where low_fats = 'Y' and recyclable = 'Y'
Day 52 /djdj/challange/day52.sql
31 Views
0 Comments
# Write your MySQL query statement below
SELECT employee_id, department_id
FROM Employee
WHERE primary_flag = 'Y'
OR employee
Day 53 /djdj/challange/day53.sql
40 Views
0 Comments
import pandas as pd

def rearrange_products_table(products: pd.DataFrame) -> pd.DataFrame:
# return pd.melt(products, id_var
Day 54 /djdj/challange/day54.sql
41 Views
0 Comments
SELECT user_id, MAX(time_stamp) AS last_stamp
FROM Logins
WHERE YEAR(time_stamp) = 2020
GROUP BY user_id;
Day 55 /djdj/challange/day55.sql
29 Views
0 Comments
# Write your MySQL query statement below
select 'Low Salary' as category, count(*) as accounts_count from Accounts where income
Day 56 /djdj/challange/day56.sql
29 Views
0 Comments
# Write your MySQL query statement below
select s.employee_id from Salaries as s
where s.employee_id NOT IN (select e.employee_i
Day 57 /djdj/challange/day57.sql
41 Views
0 Comments
# Write your MySQL query statement below
SELECT employee_id FROM Employees
WHERE salary < 30000 and manager_id not in (SELECT em
Day 58 /djdj/challange/day58.sql
41 Views
0 Comments
# Write your MySQL query statement below
select teacher_id, count(distinct subject_id) as cnt from Teacher
group by teacher_id;
Day 59 /djdj/challange/day59.sql
26 Views
0 Comments
# Write your MySQL query statement below
SELECT user_id, email
FROM Users
WHERE email REGEXP '^[A-Za-z0-9_]+@[A-Za-z]+.com';
Day 6 /djdj/challange/day6.sql
74 Views
0 Comments
SELECT name
FROM city
WHERE countrycode = 'JPN';
Day 60 /djdj/challange/day60
20 Views
0 Comments
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
for(int i=0;i<nums.size();i++){

Day 61 /djdj/challange/day61.php
19 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums1
* @param Integer[] $nums2
* @return Float
*/
functio
Day 62 /djdj/challange/day62.php
23 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @return Integer
*/
function removeDuplicates(&$nums) {

Day 63 /djdj/challange/day63.php
18 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @param Integer $val
* @return Integer
*/
function r
Day 64 /djdj/challange/day64.php
21 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @param Integer $target
* @return Integer[]
*/
funct
Day 65 /djdj/challange/day65.c
20 Views
0 Comments
int searchInsert(int* nums, int numsSize, int target) {
for (int i = 0; i < numsSize; i++) {
if (nums[i] >= target)
Day 66 /djdj/challange/day66.py
18 Views
0 Comments
class Solution(object):
def permute(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]

Day 67 /djdj/challange/day67.php
18 Views
0 Comments
class Solution {

/**
* @param Integer[] $digits
* @return Integer[]
*/
function plusOne($digits) {

Day 68 /djdj/challange/day68.php
22 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @return NULL
*/
function sortColors(&$nums) {
so
Day 69 /djdj/challange/day69.php
23 Views
0 Comments
class Solution {

/**
* @param Integer[]
* @return Integer
**/
function singleNumber($nums) {
$re
Day 7 /djdj/challange/day7.sql
113 Views
0 Comments
/*
https://www.hackerrank.com/challenges/weather-observation-station-3/problem
*/

SELECT DISTINCT city
FROM station
WHERE MOD
Day 70 /djdj/challange/day70.php
22 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @return Integer
*/
function majorityElement($nums) {

Day 71 /djdj/challange/day71.php
21 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @return Boolean
*/
function containsDuplicate($nums) {

Day 72 /djdj/challange/day72.php
14 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @return Integer
*/
function missingNumber($nums) {

Day 73 /djdj/challange/day73.php
14 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @return NULL
*/
function moveZeroes(&$nums) {
$j
Day 74 /djdj/challange/day74.php
10 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @return Integer
*/
function findDuplicate($nums) {

Day 75 /djdj/challange/day75.php
11 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums1
* @param Integer[] $nums2
* @return Integer[]
*/
fun
Day 77 /djdj/challange/day77.php
10 Views
0 Comments
class Solution {

/**
* @param String[] $words
* @return String[]
*/
function findWords($words) {

Day 78 /djdj/challange/day78.php
11 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @return Integer[]
*/
function findErrorNums($nums) {

Day 79 /djdj/challange/day79.c
12 Views
0 Comments
int search(int* nums, int numsSize, int target) {
int lb=0, ub=numsSize-1, mid;
while(lb<=ub){
mid = (lb+ub)/2;

Day 8 /djdj/challange/day8.sql
114 Views
0 Comments
/*
https://www.hackerrank.com/challenges/weather-observation-station-1/problem
*/

SELECT city, state
FROM station;
Day 80 /djdj/challange/day80.php
12 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @return Integer
*/
function pivotIndex($nums) {

Day 81 /djdj/challange/day81.php
11 Views
0 Comments
class Solution {

/**
* @param String[] $letters
* @param String $target
* @return String
*/
functio
Day 82 /djdj/challange/day82.php
10 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @return Boolean
*/
function isMonotonic($nums) {

Day 83 /djdj/challange/day83.py
6 Views
0 Comments
class Solution(object):
def addToArrayForm(self, num, k):
"""
:type num: List[int]
:type k: int

Day 84 /djdj/challange/day84.php
5 Views
0 Comments
class Solution {

/**
* @param Integer[] $arr
* @return Boolean
*/
function uniqueOccurrences($arr) {

Day 85 /djdj/challange/day85.php
2 Views
0 Comments
class Solution {

/**
* @param Integer[][] $coordinates
* @return Boolean
*/
function checkStraightLine($
Day 86 /djdj/challange/day86.php
2 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @return Integer
*/
function findNumbers($nums) {

Day 87 /djdj/challange/day87.php
3 Views
0 Comments
class Solution {

/**
* @param Integer[] $arr
* @return Integer[]
*/
function arrayRankTransform($arr) {

Day 88 /djdj/challange/day88.php
4 Views
0 Comments
class Solution {

/**
* @param Integer[][] $grid
* @return Integer
*/
function countNegatives($grid) {

Day 89 /djdj/challange/day89.php
4 Views
0 Comments
class Solution {

/**
* @param Integer[] $nums
* @return Integer[]
*/
function smallerNumbersThanCurrent(
Day 9 /djdj/challange/day9.sql
81 Views
0 Comments
/*
https://www.hackerrank.com/challenges/weather-observation-station-4/problem
*/

SELECT COUNT(city) - COUNT(DISTINCT CITY)
FR
Day 90 /djdj/challange/day90.php
2 Views
0 Comments
class Solution {

/**
* @param Integer[] $arr
* @return Integer
*/
function findLucky($arr) {
$a