Ad
Lists
Code
Diff
  • #include <vector>
    
    void re_arrange(std::vector<int>& data) {
        std::sort(data.begin(), data.end(), [](int x, int y) { return std::make_pair(x % 2 != 0, x) < std::make_pair(y % 2 != 0, y); });
    }
    • #include <vector>
    • void re_arrange(std::vector<int>& data) {
    • auto it = std::partition(data.begin(), data.end(), [](int x) { return x % 2 == 0; });
    • std::sort(data.begin(), it);
    • std::sort(it, data.end());
    • std::sort(data.begin(), data.end(), [](int x, int y) { return std::make_pair(x % 2 != 0, x) < std::make_pair(y % 2 != 0, y); });
    • }
Code
Diff
  • f=__import__("operator").call
    • import operator;f=operator.call
    • f=__import__("operator").call
Code
Diff
  • import operator
    f=operator.call
    • f=lambda x:x()
    • import operator
    • f=operator.call
Fundamentals
Code
Diff
  • import random as r 
    
    class Dice:
        def __init__(self, faces):
            self.faces = faces
        def roll(self):
            return r.choice(self.faces)
        
    dice = Dice(["⚀", "⚁", "⚂", "⚃", "⚄", "⚅"])
    d = dice.roll
    • import random as r
    • class Dice:
    • def __init__(self, faces):
    • self.faces = faces
    • def roll(self):
    • return r.choice(self.faces)
    • dice = Dice(["⚀", "⚁", "⚂", "⚃", "⚄", "⚅"])
    • d = lambda :dice.roll()
    • d = dice.roll