Skip to content

Instantly share code, notes, and snippets.

View susantabiswas's full-sized avatar
🎯
Focusing

Susanta Biswas susantabiswas

🎯
Focusing
View GitHub Profile
@susantabiswas
susantabiswas / custom_comparator.cpp
Created February 5, 2021 17:15
Custom comparator usage in C++ priority queue. Three ways are described below: 1. lambda function 2. Operator overloading 3. Comparator structure
/*
https://leetcode.com/problems/top-k-frequent-elements/submissions/
*/
class Solution {
public:
struct Element {
int val;
int freq;
Element(int val, int freq): val(val), freq(freq) {};
@susantabiswas
susantabiswas / dlib_rectangle_convertor.py
Created January 15, 2021 11:08
Dlib rectangle conversion code
def dlib_rectangle_to_list(self, dlib_bbox):
"""Converts a dlib rectangle to
List(top left x, top left y, bottom right x, bottom right y)
Args:
dlib_bbox (dlib.rectangle):
Returns:
List[int]: Bounding box coordinates
"""