Skip to content

Instantly share code, notes, and snippets.

View apurvanandan1997's full-sized avatar
🏠
Working from home

Apurva Nandan apurvanandan1997

🏠
Working from home
View GitHub Profile
U-Boot SPL 2024.04-rc4-00192-g6e73d056c95 (Mar 12 2024 - 14:50:12 +0530)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.2--v09.01.02 (Kool Koala)')
SPL initial stack usage: 13448 bytes
Trying to boot from DFU
####DOWNLOAD ... OK
Ctrl+C to exit ...
Loading Environment from nowhere... OK
init_env from device 18 not supported!
Starting ATF on ARM64 core...
U-Boot SPL 2024.04-rc2-00097-g00ae3f7268b (Feb 23 2024 - 23:43:13 +0530)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.9--v09.01.09 (Kool Koala)')
Initialized 4 DRAM controllers
SPL initial stack usage: 13448 bytes
Trying to boot from MMC2
Loading Environment from nowhere... OK
Starting ATF on ARM64 core...
NOTICE: BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
U-Boot SPL 2024.04-rc2-00097-g00ae3f7268b (Feb 23 2024 - 23:36:51 +0530)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.9--v09.01.09 (Kool Koala)')
Initialized 4 DRAM controllers
SPL initial stack usage: 13448 bytes
Trying to boot from MMC2
Authentication passed
Authentication passed
Authentication passed
Loading Environment from nowhere... OK
class Solution {
public:
int leastInterval(vector<char>& tasks, int n) {
int c[26] = {0};
priority_queue<int> pq;
queue<vector<int>> q;
for(int i = 0; i < tasks.size(); i++)
c[tasks[i]-'A']++;
class Solution {
public:
vector<int> topKFrequent(vector<int>& nums, int k) {
vector<int> ret;
priority_queue <unsigned long long> q;
unordered_map <int, int> h;
for (int i = 0; i< nums.size(); i++) {
h[nums[i]] = h[nums[i]]+1;
}
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct Node Node;
struct Node {
int data;
Node *l;
Node *r;
};
#include <stdio.h>
#include <stdlib.h>
#define swap(a,b) swap_func(&a, &b)
void swap_func(int *a, int*b) {
int t = *a;
*a = *b;
*b = t;
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define c1(i) 2*i + 1
#define c2(i) 2*i + 2
#define p(i) (i-1)/2
struct Heap {
int *heap;
bool isValid(char* s) {
int stack[10000];
int top=-1;
for(int i = 0; i < strlen(s); i++)
{
switch(s[i])
{
case '(' : stack[++top] = 1;
continue;
Counting bits set, in parallel
unsigned int v; // count bits set in this (32-bit value)
unsigned int c; // store the total here
static const int S[] = {1, 2, 4, 8, 16}; // Magic Binary Numbers
static const int B[] = {0x55555555, 0x33333333, 0x0F0F0F0F, 0x00FF00FF, 0x0000FFFF};
c = v - ((v >> 1) & B[0]);
c = ((c >> S[1]) & B[1]) + (c & B[1]);
c = ((c >> S[2]) + c) & B[2];
c = ((c >> S[3]) + c) & B[3];