working on it ...

Filters

Explore Public Snippets

Sort by

Found 24k snippets

    public by DinhoPutz modified Feb 5, 2019  38  0  3  0

    An array of integers that returns colors

    Given an array with and objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively. Note: You are not supposed to use the library's sort function for this
    /*
    Given an array with and objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue.
    Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.
    Note: You are not supposed to use the library's sort function for this problem.
    
    Example:
    
    Input: [2,0,2,1,1,0]
    Output: [0,0,1,1,2,2]
    Follow up:
    
    A rather straight forward solution is a two-pass algorithm using counting sort.
    First, iterate the array counting number of 0's, 1's, and 2's, then overwrite array with total number of 0's, then 1's and followed by 2's.
    Could you come up with a one-pass algorithm using only constant space?
    */
    #include<iostream>
    #include<vector>
    #include<map>
    #include<algorithm>
    using namespace std;
    class Solution {
    public:
    	static void sortColors(vector<int>&& nums) {
    		map <int, int> m_int;
    		for (const auto& num : nums) {
    			m_int[num]++;
    		}
    		nums.clear();
    		for (auto& m : m_int) {
    			for (int i = 0;i < m.second;++i) {
    				cout << m.first<<" ";
    				nums.push_back(m.first);
    			}
    		}
    
    	}
    };
    int main() {
    	Solution::sortColors({ 2,0,2,1,1,0 });
    }

    public by simonwalker modified Jan 16, 2019  195  1  3  0

    Magento 2 Call For Price Extension By FME

    Magento 2 Call for price extension allows you to hide product prices from selected user groups or store views. You can replace the price option with ‘Get a quote’ popup, an image, or an alternative page. Subsequently, you can hide other Calls-to-action like ‘Add to Cart’, ‘Add to Wishlist’, and ‘Add to compare.’ Set conditions to restrict the price
    // code here 						

    public by simonwalker modified Dec 19, 2018  69  0  3  0

    Magento 2 Customer Attributes Extension | FME

    Pursue a user experience design of the sign-up form by adding easy to answer attributes using Magento 2 Customer Attributes Extension. This extension empowers you to put 10 types of attributes on a registration form to intake data from users.Now the next thing is that you can apply validation on custom attributes to avoid errors while entering data
    // Enter here the actual content of the snippet.						

    public by simonwalker modified Dec 13, 2018  160  0  3  0

    Magento 2 Gift Wrap Extension

    Offer gift wrapping facility to your eCommerce store customers using Magento 2 gift wrap extension. This amazing extension lets you add lots of gift wraps with each product. To help users in choosing gift wrap, you can categorize each gift wrap based on the basis of occasions like: birthday, wedding, promotion etc. Show price of gift wrap as well a
    // Enter here the actual content of the snippet.												

    public by serpa modified Nov 6, 2018  52  1  2  0

    // Leilão Prefeitura de Antônio Carlos.

    C++
    //// Leilão Prefeitura de Antônio Carlos.						

    public by simonwalker modified Oct 1, 2018  232  1  4  0

    Magento 2 Add Field to Checkout Extension | FME

    With Magento 2 Add Field to Checkout Extension, you can create as many fields as you want to display on the checkout page of your online store. You can choose any field type like text field, text area, date, etc. and configure its data validation as well to prevent users from entering wrong information.Using this Magento 2 Custom Checkout Fields yo
    // Enter here the actual content of the snippet.						
    												

    public by simonwalker modified Sep 3, 2018  176  1  3  0

    Magento 2 Responsive E-Mail Template Extension By FME

    Magento 2 Email Templates extension helps you customize emails for better communication with the buyers and users of your eCommerce website. With 3 different themes, you can choose an appealing layout and design for the transactional emails. Magento email templates sets you free to select between Blue Lagoon, Black and Red Tux, and Orange Peak whic
    // Enter here the actual content of the snippet.						

    public by simonwalker modified Aug 30, 2018  211  0  4  0

    Magento 2 Size Chart Extension By FME

    Magento 2 Size Chart extension allows you to display product size guide so that customers can select and order the right size. You can create, customize, and assign an unlimited number of size charts to your store items using Magento 2 size chart. Upload an image, enter data, or import size charts. Define rules to assign size charts to specific pro
    // Enter here the actual content of the snippet.												

    public by simonwalker modified Aug 29, 2018  139  0  3  0

    Magento 2 Canonical URLs Extension By FME

    Magento 2 Canonical URL extension helps you remove duplicate content issues from your eCommerce website with the addition of canonical Meta tags. You can add Magento canonical tags to products, categories, and CMS pages to define its relevancy with other pages. Magento canonical tags extension can configure the addition of canonical meta tags to a
    // Enter here the actual content of the snippet.						

    public by jewie1000 modified Jul 20, 2018  597  9  4  1

    Best Forty Aimbot/ESP Users | CB:RO Hackers

    DanielTCZ#0768
    ! Yu_riTCZ#2291
    fire#1443
    krump#8883
    x0hs#9452
    Frost#7467
    DaveTCZ#1966
    Arkey#9403
    Duke101#1210
    FallenGrim#8461
    GhOoOsT_T#4768
    ugunszelis#7328
    Milooue#6934
    tristris#3368
    floppib#2082
    mightybaseplate#0001
    Kroucher#7634
    remm#1160
    ItsFergLad#0761
    Wood#4408
    Paragon#7930
    Foamy#2227
    XexerTV(RipX)#4660
    ProToType#9739
    MaxNero#9511
    𝓀𝑒𝓋𝒾𝓂𝑒𝒽𝒶𝓂#7092
    Flaming#4421
    Lun4rSpy#3839
    Khayso#3875
    gnome#0962
    oRq_z#6991
    Corn#0505
    Cold#1621
    EU | ✪ EzGamingTv12#8168
    StatTrakDoggo#7793
    Ziovixx#5012
    レイチェル・ガードナ#0890
    DeclaredTruth#3896
    J0sh#4948
    www#8902												
    • Public Snippets
    • Channels Snippets