Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 225107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:22:51+00:00 2026-05-11T19:22:51+00:00

This problem is similar to blind SQL injections. The goal is to determine the

  • 0

This problem is similar to blind SQL injections. The goal is to determine the exact value of a string, and the only test you can do is to see if a DOS-style wildcard (? = any character, * = any number of any characters) you specify is matched by the string. (So practically you only have access to a bool DoesWildcardMatch(string wildcard) function).

The straight-forward way is to test against a*, b*, c*... until you find the first letter, then repeat. Some optimizations I can think of:

  • search for *a*, *b* etc. to determine the character set
  • when a match on *x* is found, perform divide-et-impera (*a*x*, *b*x*, ...)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:22:51+00:00Added an answer on May 11, 2026 at 7:22 pm

    A first thought. You can determin the length n of the string in O(log2(n)).

    • Check Z* where Z represents k question marks starting with 0, then 1, and then doubling the number of question marks with every check until no match occurs. n must be between k / 2 and k
    • Find the exact length using the same pattern changing k in the same way as binary search does.

    Knowing the exact length might help to perform a kind of divide-et-impera in the spatial domain.

    UPDATE

    If you know the length, you can use the same pattern to correctly locate a symbol.

    Example:

        ..X. ..XX (spaces added for readability)
    
                                  + symbol may be X
                                  - symbol is not X
                                  X symbol is X
    
        *X*         => MATCH      ++++ ++++
        *X*   ????  => MATCH      ++++ ++++
        *X*?? ????  => NO MATCH   --++ ++++
        ??X?  ????  => MATCH      --X+ ++++
        ??XX  ????  => NO MATCH   --X- ++++
        ??X?  *X*?? => NO MATCH   --X- --++
        ??X?  ??X?  => MATCH      --X- --X+
        ??X?  ??XX  => MATCH      --X- --XX
    

    For string length n and alphabet size m this will take about O(log2(n)) to find the length of the string, about O(n • log2(n)) to correctly place n symbols, and O(m) to find the used symbols – summing all together yields O(n • log2(n) + m).

    I could imagine that it is possible to speed this up by merging several steps – maybe test for used symbols while determining the string length or simultaneously locating two (or even more?) symbols in the first and second half of the string. This will require to recheck the merged steps in isolation if the check fails in order to determine which check faild. But as long as the merged check succeeds, you gain information on both.

    Maybe I will calculate that tomorrow in order to see if it will really speed the thing up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This problem is similar to when creating alternate colour table-rows, only we are dealing
My example is similar to this - The only problem is I cannot rewrite
I have a similar problem to this post . I need to display up
I noticed some similar questions about this problem when I typed the title, but
This is a similar problem: Link Which was solved by calling GetAsyncKeyState(). While all
I notice this thread: Fastish Python/Jython IPC , and I have a similar problem,
This is similar to the cutting stock problem , but with a slight difference.
Similar to this question: link However I have already mastered that. My problem is
This problem crops up every now and then at work. Our build machine can
My problem can be easily defined with the following code: self.Bind(wx.EVT_MENU_OPEN, self.OnAbout) This will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.