This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution { | |
| public boolean check(int freq[], int k) { | |
| //check all characters count | |
| for(int p : freq) | |
| if(p != 0 && p < k) | |
| return false; | |
| return true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution { | |
| public: | |
| bool check(vector<int> &freq, int k) | |
| { | |
| //check all characters count | |
| for(int p : freq) | |
| if(p != 0 && p < k) | |
| return false; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution { | |
| public String longestCommonPrefix(String[] strs) { | |
| //edge case, empty array | |
| if(strs==null || strs.length==0) return ""; | |
| //empty string | |
| String ans=""; | |
| //200 is the max possible length of string, as per constraints |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution { | |
| public: | |
| string longestCommonPrefix(vector<string>& strs) { | |
| //edge case, empty array | |
| if(strs.empty()) return ""; | |
| //empty string | |
| string ans; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="image-upload container"> | |
| <h2>Add a new Image</h2> | |
| <label for="myfile"><h3>Select image :</h3></label> | |
| <input type="file" id="myfile" @change="onFileSelected"> | |
| <br> | |
| <button type="button" class="btn btn-info" @click="onUpload">Upload</button> | |
| </div> | |
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="image-box"> | |
| <img :src="image.url" :alt="image.name" class="img-fluid my-image" ref="rimage"> | |
| <div class="middle"> | |
| <button class="btn btn-info" @click="copyToClipboard">Copy Address</button> | |
| </div> | |
| </div> | |
| </template> | |
| <script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="images-box container"> | |
| <h2>Gallery</h2> | |
| <router-link :to="{name : 'AddImage'}"> | |
| <button type="button" class="btn btn-success add-btn btn-lg">Add a new Image</button> | |
| </router-link> | |
| <div v-if="images" class="images-display"> | |
| <div v-for="image of images" :key="image.name"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="editProduct container"> | |
| <h2>Edit Product</h2> | |
| <form> | |
| <div class="form-group"> | |
| <label>Category</label> | |
| <select class="form-control" v-model="category_id" required> | |
| <option v-for="category of categories" :key="category.id" :value="category.id">{{category.categoryName}}</option> | |
| </select> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="product-box"> | |
| <div class="row"> | |
| <div class="col-4"> | |
| <img class="img-fluid" v-bind:src="product.imageURL" alt="product-image"> | |
| </div> | |
| <div class="col-8"> | |
| <router-link :to="{name : 'EditProduct', params : {id : product.id} }"> | |
| <button class="btn btn-primary edit_btn">Edit</button> | |
| </router-link> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="addProduct container"> | |
| <h2>Add new Product</h2> | |
| <form> | |
| <div class="form-group"> | |
| <label>Category</label> | |
| <select class="form-control" v-model="category_id" required> | |
| <option v-for="category of categories" :key="category.id" :value="category.id">{{category.categoryName}}</option> | |
| </select> | |
| </div> |
NewerOlder